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

Doubt in Submit..... Return

Former Member
0 Likes
3,477

Hi all,

I've got a doubt in the Submit statement. I have a prgm say 'ABC' and I am calling another executable pgm say 'XYZ' using "submit". In the pgm XYZ, I put some data in an internal table. Now, i wanted to get this data in the calling pgm (i.e) ABC.

Can anyone guide me as how to go about it???

TIA,

Sinthu

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,407

There are two ways, you can send it using import export,

or as select options.

You can give as many internal tables as you want using IMPORT and export parameters.

Program XYZ.

Itab like table of dbtab.

IMPORT itab[] FROM MEMORY ID 'PAR'.

PROGRAM abc.

Itab like table of dbtab.

EXPORT itab[] TO MEMORY ID 'PAR'.

Thanks,

Susmitha

Message was edited by: Susmitha Thomas

Message was edited by: Susmitha Thomas

16 REPLIES 16
Read only

Former Member
0 Likes
1,407

Hi sinthu,

1. U will have to use EXPORT / IMPORT concept.

2. See F1 help on this commands.

3. EXPORT ITAB TO MEMORY ID 'ITAB'.

IMPORT ITAB FROM MEMORY ID 'ITAB'.

regards,

amit m.

Read only

0 Likes
1,407

refer.

Read only

Former Member
0 Likes
1,407

Hi,

Use export <ITAB1> to MEMORY ID 'XYZ' in the first program.

And use import <ITAB1> from MEMORY ID 'XYZ" in the second program.

Hope this helps.

Regs,

venkat Ramanan

Read only

Former Member
0 Likes
1,408

There are two ways, you can send it using import export,

or as select options.

You can give as many internal tables as you want using IMPORT and export parameters.

Program XYZ.

Itab like table of dbtab.

IMPORT itab[] FROM MEMORY ID 'PAR'.

PROGRAM abc.

Itab like table of dbtab.

EXPORT itab[] TO MEMORY ID 'PAR'.

Thanks,

Susmitha

Message was edited by: Susmitha Thomas

Message was edited by: Susmitha Thomas

Read only

0 Likes
1,407

Hi sushmita,

1. Should this memory id 'PAR' be predefined anywhere in the pgm or is it just an id ?

2. I tried using import export. But in my called program i am getting the data in my itab. But in the calling pgm, it is not getting populated inspite of using import.

This is my code.

LOOP AT IT_KNVP.

SUBMIT ZSDNEWAGING USING SELECTION-SCREEN 1100

WITH P_BUKRS = 'XXX'

WITH S_KUNNR = IT_KNVP-KUNNR

WITH P_DATE = P_DATE

WITH DUEDATE1 = '000'

WITH DUEDATE2 = '007'

WITH DUEDATE3 = '015'

WITH DUEDATE4 = '021'

WITH DUEDATE5 = '028'

WITH P_SUM = 'X'

AND RETURN.

EXPORT IT_SUM[] TO MEMORY ID 'PAR'.

ENDLOOP.

In the pgm zsdnewaging, there is data in it_sum table.

Read only

0 Likes
1,407

You should be using this EXPORT stmt before the SUBMIT call.

Rgds

Subbu

Read only

0 Likes
1,407

Is the parameter ID maintained in in table TPARA? If not you will have to add it via SM30 (and probably have to start the name with "Y" or "Z".

Read only

0 Likes
1,407

Hi subbu,

I tried putting export before the submit call too.. I have also declared the internal table.

Then why is teh data not getting populated in the first program ?

Read only

0 Likes
1,407

Hi Sindhu,

YOu dont have to define parameter id.

Use the export call before submit.

Internal table IT_SUM[] should have the same definition in both programs. Also make sure you include [] to pass the table values in both the programs.

Thanks,

Susmitha

Read only

0 Likes
1,407

Hi kishan

I have maintained the parameter id in the TPARA table.

Read only

0 Likes
1,407

Hi sushumita,

Thanks.

But i didnt get your sentence "Also make sure you include [] to pass the table values in both the programs."

In my first pgm, i am passing values to the parameters and select options.

EXPORT IT_SUM[] TO MEMORY ID 'ZPARA'.

SUBMIT ZSDNEWAGING USING SELECTION-SCREEN 1100

WITH P_BUKRS = 'SBPL'

WITH S_KUNNR = IT_KNVP-KUNNR

WITH P_DATE = P_DATE

WITH DUEDATE1 = '000'

WITH DUEDATE2 = '007'

WITH DUEDATE3 = '015'

WITH DUEDATE4 = '021'

WITH DUEDATE5 = '028'

WITH P_SUM = 'X'

AND RETURN.

In the second program, using these values, it does a set of performs and finally appends the data in the it_sum table as follows

SORT IT_FINAL BY BUKRS GSBER KUNNR.

LOOP AT IT_FINAL.

WA_NAME = IT_FINAL-NAME1.

AT END OF KUNNR.

SUM.

IT_SUM-BUKRS = IT_FINAL-BUKRS.

IT_SUM-GSBER = IT_FINAL-GSBER.

IT_SUM-BWKEY = IT_FINAL-BWKEY.

IT_SUM-GTEXT = IT_FINAL-GTEXT.

IT_SUM-KUNNR = IT_FINAL-KUNNR.

IT_SUM-NAME1 = WA_NAME.

IT_SUM-DEBIT = IT_FINAL-DEBIT.

IT_SUM-CREDIT = IT_FINAL-CREDIT.

IT_SUM-TOTAL = IT_FINAL-TOTAL.

IT_SUM-WA_AGE1 = IT_FINAL-WA_AGE1.

IT_SUM-WA_AGE2 = IT_FINAL-WA_AGE2.

IT_SUM-WA_AGE3 = IT_FINAL-WA_AGE3.

IT_SUM-WA_AGE4 = IT_FINAL-WA_AGE4.

IT_SUM-WA_AGE5 = IT_FINAL-WA_AGE5.

APPEND IT_SUM.

ENDAT.

ENDLOOP.

IMPORT IT_SUM[] FROM MEMORY ID 'ZPARA'.

I have used the import stmt here. The it_sum table has got records.

but when it comes back to the main program, the it_sum table of the main program is blank. both the programs have got the same str for it_sum.

Any help?

Read only

0 Likes
1,407

Hello Sinthu,

I think you have got it the opposite way.

You need the values that you have appended in the table IT_SUM in the second program, in the first program when you return to it, right?

So this is how you should do it.

Second program:

SORT IT_FINAL BY BUKRS GSBER KUNNR.

LOOP AT IT_FINAL.

WA_NAME = IT_FINAL-NAME1.

AT END OF KUNNR.

SUM.

IT_SUM-BUKRS = IT_FINAL-BUKRS.

IT_SUM-GSBER = IT_FINAL-GSBER.

IT_SUM-BWKEY = IT_FINAL-BWKEY.

IT_SUM-GTEXT = IT_FINAL-GTEXT.

IT_SUM-KUNNR = IT_FINAL-KUNNR.

IT_SUM-NAME1 = WA_NAME.

IT_SUM-DEBIT = IT_FINAL-DEBIT.

IT_SUM-CREDIT = IT_FINAL-CREDIT.

IT_SUM-TOTAL = IT_FINAL-TOTAL.

IT_SUM-WA_AGE1 = IT_FINAL-WA_AGE1.

IT_SUM-WA_AGE2 = IT_FINAL-WA_AGE2.

IT_SUM-WA_AGE3 = IT_FINAL-WA_AGE3.

IT_SUM-WA_AGE4 = IT_FINAL-WA_AGE4.

IT_SUM-WA_AGE5 = IT_FINAL-WA_AGE5.

APPEND IT_SUM.

ENDAT.

ENDLOOP.

EXPORT IT_SUM[] TO MEMORY ID 'ZPARA'.

First Program.

SUBMIT ZSDNEWAGING USING SELECTION-SCREEN 1100

WITH P_BUKRS = 'SBPL'

WITH S_KUNNR = IT_KNVP-KUNNR

WITH P_DATE = P_DATE

WITH DUEDATE1 = '000'

WITH DUEDATE2 = '007'

WITH DUEDATE3 = '015'

WITH DUEDATE4 = '021'

WITH DUEDATE5 = '028'

WITH P_SUM = 'X'

AND RETURN.

IMPORT IT_SUM[] FROM MEMORY ID 'ZPARA'.

You will get your values here.

Thanks,

Susmitha.

Let me know if you got it right!

Read only

0 Likes
1,407

Thanks a lot susmitha.It works now....

Read only

0 Likes
1,407

Hi,

I know this question is anwered. But this suites my requirement. I have an issue with this. I am trying to submit statement from my bapi. When I test this bapi, I get the report results on my screen, i.e alv grid on the screen. Which I don't want to. Please help me in getting rid of showing the report on the screen. I just need the results into my bapi.

Thanks in advance.

Thank you,

Surya.

Read only

0 Likes
1,407

Hi Susmitha,

I have a requirement like this only but the called program is a standard program.

Program Name : RFUMSV00

The output table in this program is :  gt_alv TYPE STANDARD TABLE OF rfums_tax_gt_alv, which consists 6 internal tables.

My requirement is to get the output data of RFUMV00 into a custom program and pass respective values to my own internal table of custom program.

Please suggest how to achieve it. It is in high priority escalation.

Many thanks in advance.

Regards,

Amit Kumar barik

Read only

Former Member
0 Likes
1,407

You may use EXPORT and IMPORT statements.Please go thru the documentation of these:

Exporting two fields and an internal table to the database table INDX:

TABLES INDX.

TYPES: BEGIN OF ITAB3_TYPE,

CONT(4),

END OF ITAB3_TYPE.

DATA: INDXKEY LIKE INDX-SRTFD VALUE 'KEYVALUE',

F1(4), F2 TYPE P,

ITAB3 TYPE STANDARD TABLE OF ITAB3_TYPE WITH NON-UNIQUE

DEFAULT KEY INITIAL SIZE 2,

WA_INDX TYPE INDX.

  • Fill the data fields before CLUSTR

  • before the actual export

INDX-AEDAT = SY-DATUM.

INDX-USERA = SY-UNAME.

  • Export der Daten.

EXPORT F1 FROM F1

F2 FROM F2

ITAB3 FROM ITAB3

TO DATABASE INDX(ST) FROM WA_INDX ID INDXKEY.

Importing two fields and an internal table:

TYPES: BEGIN OF TAB3_TYPE,

CONT(4),

END OF TAB3_TYPE.

DATA: INDXKEY LIKE INDX-SRTFD,

F1(4), F2 TYPE P,

TAB3 TYPE STANDARD TABLE OF TAB3_TYPE WITH

NON-UNIQUE DEFAULT KEY,

WA_INDX TYPE INDX.

INDXKEY = 'INDXKEY'.

IMPORT F1 = F1

F2 = F2

TAB3 = TAB3 FROM DATABASE INDX(ST) ID INDXKEY

TO WA_INDX.

I think this should work out for you.

Subbu