‎2007 Feb 07 12:40 PM
Hi All,
How to Submit from one program to another program using internal table values minimum 7 int tables without using the seletion screen
thanks
raj
‎2007 Feb 07 12:45 PM
One way would be to export all internal tables and import in the called program.
Krishna
‎2007 Feb 07 12:52 PM
Data: it001 type table of MARA.
select * into table it001 from MARA.
export it001 = it001 to memory id 'ABCD'.
In the other program you can import these values
use this statement in the INITIALISATION event.
import it001 = it001 from memory id 'ABCD'.
if u want to supress the selection screen, if you do not use "VIA SELECTION SCREEN" addition in submit command, SUBMIT statement should suppress the selection screen.
dont forget to award points if found helpful
‎2007 Feb 07 1:06 PM
u need to use import and export statements in ur programs....
in ur first program use export and in ur second program use import...
in ur first program....
declare the 7 internal tables.
export <internal table1> to memory id 'IT1'.
export <internal table2> to memory id 'IT2'.
export <internal table3> to memory id 'IT3'.
export <internal table4> to memory id 'IT4'.
export <internal table5> to memory id 'IT5'.
export <internal table6> to memory id 'IT6'.
export <internal table7> to memory id 'IT7'.
in ur second program....
declare the 7 internal tables as same structure used in ur first program.
import <internal table1> from memory id 'IT1'.
import <internal table2> from memory id 'IT2'.
import <internal table3> from memory id 'IT3'.
import <internal table4> from memory id 'IT4'.
import <internal table5> from memory id 'IT5'.
import <internal table6> from memory id 'IT6'.
import <internal table7> from memory id 'IT7'.
‎2007 Feb 07 5:32 PM
Hi All,
Thank you very much for your inputs.
i am facing another issue:
For each 10,000 records it should trigger a job (we are trying to call a program) were the validation will be done only through the other program.
please find the code mentioned below :
TABLES : but000.
DATA: int_bp LIKE but000 OCCURS 0 WITH HEADER LINE.
data released like BTCH0000-CHAR1.
DATA: jobnumber LIKE tbtcjob-jobcount, " Job ID and
jobname LIKE tbtcjob-jobname, " job name.
startdate LIKE tbtcjob-sdlstrtdt, " Start-time
starttime LIKE tbtcjob-sdlstrttm, " window specs.
laststartdate LIKE tbtcjob-laststrtdt,
laststarttime LIKE tbtcjob-laststrttm,
job_released LIKE btch0000-char1. " JOB_CLOSE: Was job released?
DATA : l1 TYPE i,
b_size TYPE i,
b_cursor TYPE cursor.
INITIALIZATION.
b_size = 5000.
START-OF-SELECTION.
OPEN CURSOR WITH HOLD b_cursor
FOR
SELECT *
FROM but000
WHERE bpkind = 'AA'.
IF sy-subrc = 0.
DO.
FETCH NEXT CURSOR b_cursor INTO TABLE int_bp
PACKAGE SIZE b_size.
Note : here in this point we are getting a dump for the second job trigger.
IF sy-subrc = 0.
CLEAR jobname.
CONCATENATE sy-repid sy-datum sy-uzeit INTO jobname.
export int_bp to memory id 'ABC'.
CALL FUNCTION 'JOB_OPEN'
EXPORTING
jobname = jobname
IMPORTING
jobcount = jobnumber.
EXCEPTIONS
cant_create_job = 1
invalid_job_data = 2
jobname_missing = 3
OTHERS = 4
CALL FUNCTION 'JOB_SUBMIT'
EXPORTING
authcknam = sy-uname
jobname = jobname
jobcount = jobnumber
report = 'YTEST_RRR'.
variant = lv_variant.
*
SUBMIT ytest_rrr
VIA JOB jobname NUMBER jobnumber
AND RETURN.
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
event_periodic = 'X'
jobcount = jobnumber
jobname = jobname
strtimmed = 'X'
IMPORTING
job_was_released = released
.
else.
EXIT.
ENDIF.
ENDDO.
calling program :
REPORT YTEST_RRR .
data itab1 like but000 occurs 0 with header line.
data l type i.
import itab1 from memory id 'ABC' .
describe table itab1 lines l.
free memory id 'ABC'.
write:/ 'total records are:', l.
Please give your suggestion why its going for dump in the second iteration.
thanks in advance.
‎2007 Feb 07 2:12 PM