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

Variable passsing from Program to SAP Script.

Former Member
0 Likes
3,315

Hi,

I have a Z-layout and a Z-program which is a copy of the Standard SAP Code and modifications made to it. it is triggered through the Paymemt run F110. I have a structure called regup and reguh which has fields like belnr, xblnr, dmbtr, wskto, lifnr, name1 etc. for some reasons I am taking some  of these values in the other structure gs_itab which has the same field names. During the FORM I am passing on the values from regup to gs_itab and then calling the FM WRITE_FORM with the Window and the Element name.

I have the Values in both regup-belnr and also in gs_itab-belnr. Both show the same values. Somehow when I move to SAP Scirpt duirng debugging I have the Value in the variable regup-belnr and not in gs_itab-belnr. It is blank.

I have declared the Internal table gt_itab and the Structure gs_itab locally in the FORM ENDORM from where the WRITE_FORM is being called.

Somehow during debugging of the Layoutset I get only value in regup-belnr and not in the gs_itab-belnr. That value is not being passed to the Layoutset. Can any one please let me know what I should do to get the value in gs_itab-belnr and also in other variables as mentioned above in the gs_itab.  I was Initially using &regup-belnr& which was giving me the desired redult within the layoutset  but now I have to change to &gs_itab-belnr& due to some reasons and not getting the result due to it.

Please guide me the right way so that I can print my values correctlly.

Thanks and Regards,

Deepak.

4 REPLIES 4
Read only

eduardo_hinojosa
Active Contributor
0 Likes
1,388

Hi

If you want to see in SAPscript GT_ITAB must be declared in the dictionary (as a structure for instance), so, define your structure in SE11 in your range name (ZGT_ITAB for instance) and move the values to ZG_ITAB before the WRITE_FORM. After, in your editor in SAPscript write &ZGT_ITAB-FIELD& and revert.

I hope this helps you

Regards

Eduardo

Read only

Former Member
0 Likes
1,388

Hi,

Check whether you declare clear statement after value populated that field.

May have a look on pass by value or reference you are using.

Regards,

John.

Read only

Former Member
0 Likes
1,388

Hi Deepak,

Just declare gs_itab as global field, it will work.

Your local variable will not be visible inside SAP Script.

Pls post if problem persists.

Thanking You All.

Read only

arindam_m
Active Contributor
0 Likes
1,388

Hi,

The program for F110 the basic flow is the data is printed on the run from REGUP and REGUH via the script. The driver program being used is RFFOUS_C. The passing of values happens in Include RFFORI01 line 51 via LOOP on the entries just created in REGUH and REGUP.

Now Global declarations is in Include RFFORI00. One way is to enhance it and include it in there or declare the internal table at the start of LOOP in Include RFFORI01 and copy the data in REGUP and REGUH to you internal work areas. (REGUP & REGUH These are work areas too in the loop check the Tables statement at top. )

That should help you put the data at the beginning of the loop. and will be available till the end of it all the WRITE_FORM and other work happens in this. Hope this helps to get a better idea of the flow.

Cheers,
Arindam