cancel
Showing results for 
Search instead for 
Did you mean: 

Getting internal table values from standard program to script

0 Kudos

Hi Experts,

I have developed a script (custom script Z...),and I am using standard program RFFOUS_C as my driver program.

I have all the line items (invoice numbers) present in the internal table that is present in one of the includes of this std program,

Now how to pass this internal table to my script with out changing the std program.

I tried Perform statement, but that doesnt work.

Please Help.

Thanks & Regards,

Mahina

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi MAhina,

From here it is hard to give workfull answer but i give it a try.

If in the printprogram the tables with the values are present on the moment of printing the of wanted /E item you can add the variables to the script and it will be printed. (if that table is global defined in your program)

But you are talking about an internal table. A Table has several items. SEveral tiems must be printed in a loop. Is such a loop already present in your program including write_form? If it isn't then you have to change the program.

Changing that program to a Z version is not that difficult.

You tried a perform. A perform is doing nothing with data which exits already in your print program. In that case you have to calculate everything over again.

All together. The chance you can do it withouit changing your printprogram is small.

If you need extra info. Just ask.

Gr., Frank

Former Member
0 Kudos

Hi

write perform statement in Script editor by using and changing

Using means passing value from script to subroutine

changing means from subroutine to script

see the following example u will get an idea...

......

/: PERFORM GET_BARCODE IN PROGRAM QCJPERFO

/: USING &PAGE&

/: USING &NEXTPAGE& Using means pass any keyfields from script to Subroutine pool program

/: CHANGING &BARCODE&

/: ENDPERFORM

/

/ &BARCODE& Changing means get values from Program means subroutine pool

......

/:

and in sub routine write code like this

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 OUT_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.

Former Member
0 Kudos

Hi Sulthana,

If you have the required fields in the standard program itself then you need not to have the PERFORM statement. You just need to pass the variables form the standard program to the script.

Eg : If your standard pgm has the internal table say it_marc and has the fields of MATNR and WERKS, then you can call these variables into your script as &it_marc-matnr& and &it_marc-werks&.

Hope this will help you.