04-05-2006 3:53 PM
Hi,
I want to pass a internal table data to 2nd program from 1st program. I am using SUBMIT 2nd program and i am getting results in foreground , i am not getting in back ground .
will you face this sort of problem ever.
Please help me .
Thanks in advance .
Balaji.
04-05-2006 3:55 PM
Balaji,
Look at the EXPORT and IMPORT commands. You can EXPORT a internal from Program 1 and IMPORT the same Program 2.
Regards,
Ravi
Note : Please mark the helpful answers
04-05-2006 3:57 PM
Here is a sample code for submit command.
If you want to run as a new background job.
call function job_open
submit <program name> to sap-spool keep in spool 'X'
without spool dynpro
user g_user
via job l_jobnm number l_count
with s_batid in r_batch
and return.
call function job_close.
in this case the internal table you want to pass to another program - create a select option in the program. Populate the same in this program using ur internal table and use submit command.
04-05-2006 3:58 PM
Hi Balaji,
Please check this sample code.
DATA: number TYPE tbtcjob-jobcount,
name TYPE tbtcjob-jobname VALUE 'JOB_TEST',
print_parameters TYPE pri_params.
...
CALL FUNCTION 'JOB_OPEN'
EXPORTING
jobname = name
IMPORTING
jobcount = number
EXCEPTIONS
cant_create_job = 1
invalid_job_data = 2
jobname_missing = 3
OTHERS = 4.
IF sy-subrc = 0.
SUBMIT submitable TO SAP-SPOOL
SPOOL PARAMETERS print_parameters
WITHOUT SPOOL DYNPRO
VIA JOB name NUMBER number
AND RETURN.
IF sy-subrc = 0.
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
jobcount = number
jobname = name
strtimmed = 'X'
EXCEPTIONS
cant_start_immediate = 1
invalid_startdate = 2
jobname_missing = 3
job_close_failed = 4
job_nosteps = 5
job_notex = 6
lock_failed = 7
OTHERS = 8.
IF sy-subrc <> 0.
...
ENDIF.
ENDIF.
ENDIF.
Hope this will help.
Regards,
Ferry Lianto
04-05-2006 3:58 PM
Hi Balaji,
I think youa re using ranges or parameters to pass the internal table data to the second report.
In that case the parameters or select options in the second program must be declared as no -display.
REgards,
Ravi
04-05-2006 3:59 PM
04-05-2006 4:02 PM
04-05-2006 4:10 PM
Hi friends,
in this i want to pass S_MATNR field from i_rspar internal table.
LOOP AT i_bom INTO wa_bom.
wa_rspar-selname = C_MATNR. "'S_MATNR'.
wa_rspar-kind = c_s. "'S'.
wa_rspar-sign = c_i. "'I'.
wa_rspar-option = c_eq . "'EQ'.
wa_rspar-low = wa_bom-component.
APPEND wa_rspar TO i_rspar.
CLEAR : wa_bom,wa_rspar.
ENDLOOP.
SUBMIT sdv03v02
WITH SELECTION-TABLE i_rspar.
EXPORTING LIST TO MEMORY
AND RETURN.
in this one it is working fine in forground , it is not working in back ground. because of 52 records for MATNR FIELD.
have you face this sort of problem.
thanks in advance .
balaji.
04-05-2006 4:13 PM
Hi Balaji,
This is because u must have declared s_matnr without using no-diplay addition.
YOu should declare s_matnr in the secong prog as,
select-options: s_matnr for mara-matnr no-display.
REgards,
Ravi
04-05-2006 4:19 PM
Ravi,
S_MATNR is field in SAP Defined program (sdv03v02
) , how can we change it.
Balaji.
04-05-2006 4:48 PM
Why don't you populate ranges with MAterial nos.
And then pass the same to submit statement.
submit sdv03v02 to sap-spool keep in spool 'X'
with s_matnr in r_matnr
and return.
04-05-2006 4:11 PM
Hi Balaji,
Use can use EXPORT statement in program1 and IMPORT statement in program2.
Make sure that the <b>internal table name</b> and <b>memoryid name</b> are identical in both statements.
oops... okai, here it goes
Basic form
<b>SUBMIT rep</b>.
Addition 6
...
<b>EXPORTING LIST TO MEMORY</b>
<b>Effect</b>
Does not display the output list of the called report, but saves it in SAP memory and leaves the called report immediately. Since the calling program can read the list from memory and process it further, you need to use the addition ... AND RETURN . Also, since the called report cannot be requested for printing, the addition ... TO SAP-SPOOL is not allowed here. You can read the saved list from SAP memory with the function module 'LIST_FROM_MEMORY' and then (for example) store it in the database with EXPORT . You can process this list further with the function modules 'WRITE_LIST' , 'DISPLAY_LIST' ... of the function group "SLST" .
Regards,
Raj
Message was edited by: Rajasekhar Dinavahi
08-15-2006 9:35 AM
Hello
I am trying to investigate on the rescheduling v_v2, SDV03V02, do any one know if this works with rescheduling every night for a great number of materials and saleordres, the DC have about 12 000 different materials.
I dont know much about the transaction, but I would be happy to learn more about it, if you are using it I would like you to tell you about your experiences..
Best regards Elin