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

subroutine not working.....

Former Member
0 Likes
538

Hi friends,

I have to import values of two fields &ABC& and &CDE referring to a field &VAR& in script as follow....

/:FORM ZFORM IN PROGRAM ZPROG

/:USING &VAR&

/:CHANGING &ABC&

/:CHANGING &CDE&

/:ENDPERFORM.

I'm getting the value of &ABC& but unable to display the value of other field &CDE&.

I'm getting the value for second field when I see in debugging mode...

Because by the look...we have one In_tab(&VAR&) and two Out_Tabs(&ABC& and &CDE&) for ITCSY structure....

How to read that second Out_Tab...

How to pass the value to field &CDE&......

Thanks in advance.

1 ACCEPTED SOLUTION
Read only

bpawanchand
Active Contributor
0 Likes
479

Hi

may &CDE& in the subroutine you might have declared as other type for manipulation .what you can do is after performing all the operations you transfer the result to a character field and then you pass the value to the form

Regards

Pavan

2 REPLIES 2
Read only

Former Member
0 Likes
479

Hi,

Check this sample program. May be it will help u to find the prob.

Definition in the SAPscript form:

/: PERFORM GET_BARCODE IN PROGRAM QCJPERFO

/: USING &PAGE&

/: USING &NEXTPAGE&

/: CHANGING &BARCODE&

/: ENDPERFORM

/

/ &BARCODE&

Coding of the calling ABAP program:

REPORT QCJPERFO.

FORM GET_BARCODE TABLES IN_PAR STUCTURE ITCSY

OUT_PAR STRUCTURE ITCSY.

DATA: PAGNUM LIKE SY-TABIX, "page number

NEXTPAGE LIKE SY-TABIX. "number of next page

READ TABLE IN_PAR WITH KEY u2018PAGEu2019.

CHECK SY-SUBRC = 0.

PAGNUM = IN_PAR-VALUE.

READ TABLE IN_PAR WITH KEY u2018NEXTPAGEu2019.

CHECK SY-SUBRC = 0.

NEXTPAGE = IN_PAR-VALUE.

READ TABLE IN_PAR WITH KEY u2018BARCODEu2019.

CHECK SY-SUBRC = 0.

IF PAGNUM = 1.

OUT_PAR-VALUE = u2018|u2019. "First page

ELSE.

OUT_PAR-VALUE = u2018||u2019. "Next page

ENDIF.

IF NEXTPAGE = 0.

OUT_PAR-VALUE+2 = u2018Lu2019. "Flag: last page

ENDIF.

MODIFY OUT_PAR INDEX SY-TABIX.

ENDFORM.

Regards,

Joy.

Read only

bpawanchand
Active Contributor
0 Likes
480

Hi

may &CDE& in the subroutine you might have declared as other type for manipulation .what you can do is after performing all the operations you transfer the result to a character field and then you pass the value to the form

Regards

Pavan