Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

NEXT LINE

Former Member
0 Likes
553

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.

4 REPLIES 4
Read only

Former Member
0 Likes
523

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

Read only

0 Likes
523

hi

i actually used only sgtct first nut i still didnt get it...please help

Read only

Former Member
0 Likes
523

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

Read only

Former Member
0 Likes
523

hh