2007 May 07 8:19 AM
Hi all am using the below code to split a field into 2 lines in a script but am not getting it ...please go thru d code and mention any changes....
code in scripts
/: PERFORM TEXT IN PROGRAM ZF143
/: USING &BSEG-SGTXT&
/: CHANGING &TEXT1&
/: CHANGING &TEXT2&
/: ENDPERFORM
T2 &TEXT1&
T3 &TEXT2&
CODE IN DRIVER PROGRAM
REPORT ZF143.
Data: text1(30) type c.
Data: text2(30) type c.
DATA:SGTXT LIKE BSEG-SGTXT.
TABLES:BSEG.
FORM TEXT TABLES IN_PAR STRUCTURE ITCSY
OUT_PAR STRUCTURE ITCSY.
READ TABLE IN_PAR WITH KEY 'BSEG-SGTXT'.
CHECK SY-SUBRC = 0.
SGTXT = IN_PAR-VALUE.
Text1 = BSEG-SGTXT+0(25).
Text2 = BSEG-SGTXT+25(25).
*READ TABLE IN_PAR WITH KEY 'BSEG-SGTXT'.
*CHECK SY-SUBRC = 0.
READ TABLE OUT_PAR WITH KEY value = 'TEXT1'.
OUT_PAR-value = text1.
MODIFY OUT_PAR TRANSPORTING VALUE WHERE value = 'TEXT1'.
READ TABLE OUT_PAR WITH KEY value = 'TEXT2'.
OUT_PAR-value = text2.
MODIFY OUT_PAR TRANSPORTING VALUE WHERE value = 'TEXT2'.
ENDFORM.
Hi all am using the below code to split a field into 2 lines in a script but am not getting it ...please go thru d code and mention any changes....
code in scripts
/: PERFORM TEXT IN PROGRAM ZF143
/: USING &BSEG-SGTXT&
/: CHANGING &TEXT1&
/: CHANGING &TEXT2&
/: ENDPERFORM
T2 &TEXT1&
T3 &TEXT2&
CODE IN DRIVER PROGRAM
REPORT ZF143.
Data: text1(30) type c.
Data: text2(30) type c.
DATA:SGTXT LIKE BSEG-SGTXT.
TABLES:BSEG.
FORM TEXT TABLES IN_PAR STRUCTURE ITCSY
OUT_PAR STRUCTURE ITCSY.
READ TABLE IN_PAR WITH KEY 'BSEG-SGTXT'.
CHECK SY-SUBRC = 0.
SGTXT = IN_PAR-VALUE.
Text1 = BSEG-SGTXT+0(25).
Text2 = BSEG-SGTXT+25(25).
*READ TABLE IN_PAR WITH KEY 'BSEG-SGTXT'.
*CHECK SY-SUBRC = 0.
READ TABLE OUT_PAR WITH KEY value = 'TEXT1'.
OUT_PAR-value = text1.
MODIFY OUT_PAR TRANSPORTING VALUE WHERE value = 'TEXT1'.
READ TABLE OUT_PAR WITH KEY value = 'TEXT2'.
OUT_PAR-value = text2.
MODIFY OUT_PAR TRANSPORTING VALUE WHERE value = 'TEXT2'.
ENDFORM.
2007 May 07 8:25 AM
Hi,
R
EPORT ZF143.
Data: text1(30) type c.
Data: text2(30) type c.
DATA:SGTXT LIKE BSEG-SGTXT.
TABLES:BSEG.
FORM TEXT TABLES IN_PAR STRUCTURE ITCSY
OUT_PAR STRUCTURE ITCSY.
READ TABLE IN_PAR WITH KEY 'BSEG-SGTXT'.
CHECK SY-SUBRC = 0.
SGTXT = IN_PAR-VALUE.
Text1 = SGTXT+0(25). " Use only SGTXT
Text2 = SGTXT+25(25). " Use only SGTXT
*READ TABLE IN_PAR WITH KEY 'BSEG-SGTXT'.
*CHECK SY-SUBRC = 0.
READ TABLE OUT_PAR WITH KEY value = 'TEXT1'.
OUT_PAR-value = text1.
MODIFY OUT_PAR TRANSPORTING VALUE WHERE value = 'TEXT1'.
READ TABLE OUT_PAR WITH KEY value = 'TEXT2'.
OUT_PAR-value = text2.
MODIFY OUT_PAR TRANSPORTING VALUE WHERE value = 'TEXT2'.
ENDFORM.
Regards
Sudheer
2007 May 07 8:27 AM
hi
i actually used only sgtct first nut i still didnt get it...please help
2007 May 07 8:36 AM
Hi
I don't know why you are using a special subroutine to split the text into two lines in this case. you can straight away write the field
&BSEG-SGTXT&
in two lines straight with offset.
in the first line T1 &BSEG-SGTXT+0(25)&
In second line T1 &BSEG-SGTXT+25(25)&
first write like this and see, is it printing or not.
Why to write the PERFORM for this ?
Reward points if useful
Regards
Anji
2007 May 10 6:49 AM
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |