02-21-2007 8:28 AM
Hi Experts,
I have a small doubt in BDC session processing. How to HARD CODE the session processing( all possible ways of processing session) in the program without forcing the user to process the session without the need for the user to go to SM35 and process it.
Thanks & Regards,
Ram.
02-21-2007 8:32 AM
02-21-2007 8:32 AM
02-21-2007 8:36 AM
Call the following souroutine after creating creating & closing session in ur program.
Here 'c_bdcname' , you pass the session name ur generating.
&----
*& Form bdc_submit
&----
Process the sessions created
----
FORM bdc_submit .
SUBMIT rsbdcsub AND RETURN EXPORTING LIST TO MEMORY
WITH mappe = c_bdcname
WITH z_verarb = 'X'
WITH fehler = ' '.
COMMIT WORK AND WAIT.
Retrieve the output from memory and place into l_abap_list
CLEAR l_abap_list.
FREE l_abap_list.
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
listobject = l_abap_list
EXCEPTIONS
not_found = 1
OTHERS = 2.
IF sy-subrc EQ 0.
CLEAR l_ascii_list.
FREE l_ascii_list.
CALL FUNCTION 'LIST_TO_ASCI'
EXPORTING
list_index = -1
TABLES
listasci = l_ascii_list
listobject = l_abap_list
EXCEPTIONS
empty_list = 1
list_index_invalid = 2
OTHERS = 3.
IF sy-subrc NE 0.
'Unable to convert list from rsbdcsub to ascii'
MESSAGE w368 WITH text-010.
ENDIF.
ENDIF.
ENDFORM. " bdc_submit
02-21-2007 8:36 AM
KB ram,
use the program RSBDCSUB.
After "BDC_INSERT"
SUBMIT rsbdcsub AND RETURN
EXPORTING LIST TO MEMORY
WITH mappe = p_sessionnanme
WITH von = w_datum
WITH bis = sy-datum
WITH z_verarb = c_true
WITH fehler = c_false
Pls. mark if useful