Thursday, October 18, 2007

Sample ABAP Program for Search Layout sets for given String

REPORT Ysearchl LINE-SIZE 132.

************************************************************************
*
* Program : Ysearchl
* Authors : Chris Harrop (chris.harrop@bigfoot.com)
* Date : March 1999
* Purpose : Searches all Y and Z layout sets for a given string
*
************************************************************************
*
* maintenance history
*
* date author purpose
*
************************************************************************

TABLES: STXL.

PARAMETERS:
STRING(128).

DATA: BEGIN OF TLINETAB OCCURS 0.
INCLUDE STRUCTURE TLINE.
DATA: END OF TLINETAB,
SUBRC LIKE SY-SUBRC.

SELECT TDNAME FROM STXL INTO (STXL-TDNAME)
WHERE TDOBJECT = 'FORM' AND ( TDNAME LIKE 'Y%' OR TDNAME LIKE 'Z%' )
AND TDID = 'TXT'.

PERFORM DISPLAY_STATUS_TEXT USING STXL-TDNAME.

REFRESH TLINETAB.
PERFORM GET_TEXT_TABLE
TABLES TLINETAB
USING 'FORM' 'TXT' STXL-TDNAME
CHANGING SUBRC.
LOOP AT TLINETAB.
IF TLINETAB-TDLINE CS STRING.
WRITE : / STXL-TDNAME, TLINETAB-TDLINE.
ENDIF.
ENDLOOP.
ENDSELECT.


* Display a message on the status bar
FORM DISPLAY_STATUS_TEXT USING VALUE(TEXT) TYPE C.
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING
TEXT = TEXT.
ENDFORM.
*
* Get the long texts for the object
*
FORM GET_TEXT_TABLE TABLES TLINETAB
USING VALUE(TDOBJECT) LIKE THEAD-TDOBJECT
VALUE(ID) LIKE THEAD-TDID
VALUE(TDNAME) LIKE THEAD-TDNAME
CHANGING SUBRC LIKE SY-SUBRC.

DATA: BEGIN OF XTHEAD OCCURS 0.
INCLUDE STRUCTURE THEAD.
DATA: END OF XTHEAD.

DATA: EINTRAEGE LIKE SY-TFILL.

DATA XTDNAME LIKE THEAD-TDNAME.
REFRESH XTHEAD.
CLEAR XTDNAME.
XTDNAME = TDNAME.

CALL FUNCTION 'SELECT_TEXT'
EXPORTING
ID = ID
LANGUAGE = SY-LANGU
NAME = TDNAME
OBJECT = TDOBJECT
IMPORTING
ENTRIES = EINTRAEGE
TABLES
SELECTIONS = XTHEAD.

REFRESH TLINETAB.

CALL FUNCTION 'READ_TEXT'
EXPORTING
ID = ID
LANGUAGE = SY-LANGU
NAME = TDNAME
OBJECT = TDOBJECT
IMPORTING
HEADER = XTHEAD
TABLES
LINES = TLINETAB
EXCEPTIONS
ID = 01
LANGUAGE = 02
NAME = 03
NOT_FOUND = 04
OBJECT = 05
REFERENCE_CHECK = 06.
SUBRC = SY-SUBRC.
ENDFORM. " FILL_ITEM_TEXT

7 comments:

Katie Doyle said...

Hey! Keep it up your work. Your blog and post are very informative. Very clear easy to understand text I am enjoying your post. Please take a look at my dissertation services in uk site and advise me further improvement.

Dissertation Help said...

Almost every article I come across has the almost same piece of information, but you provide with variation. That is what I like about your blog. Keep it up, pal!

logo design firms

Judith Walton said...

It’s really great to see this site. Give us more interesting and informative stuff. Keep doing work like this for the further also...Thanks Buddy

business logo designer

Judith Walton said...

Great post, the subject is extremely useful and informative for me. Keep doing the good work. Regards

creative logo designs

online logo designs

SEO said...

Came upon this site a while back, it's a greate pace for any one interested in Oceanology. Add you to my favorites. Good job, Good luck!
Indian wedding footwear

SEO said...

Pretty good post. I found your website perfect for my needs. Thanks for sharing the great ideas.
Bollywood sarees

Unknown said...

I was just thinking about Caribbean Cruise to start operating departing from Cozumel Island. and you've really helped out. Thanks!

Top civil engineering college in Delhi NCR