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: 
4 REPLIES 4
Read only

Former Member
0 Likes
393

ramana ,

<b>code is compulsory. your answers will be rewarded.</b>---> this is not the right way to do/post.

create a recording from SM35 and create program for that Recording .

Regards

Prabhu

Read only

Former Member
0 Likes
393

Hi,

Pls see this sample code for processing a BDC session.

FORM execute_session.

DATA : l_jobname LIKE tbtcjob-jobname ,
l_jobnumber LIKE tbtcjob-jobcount,
l_job_released LIKE btch0000-char1 .

REFRESH: int_bdc_error.

l_jobname = p_batch. "Assign session name

* open job
CALL FUNCTION 'JOB_OPEN'
EXPORTING
jobname = l_jobname
IMPORTING
jobcount = l_jobnumber
EXCEPTIONS
cant_create_job = 01
invalid_job_data = 02
jobname_missing = 03
OTHERS = 99.

IF sy-subrc NE 0.
wa_bdc_error-m_type = 'E'.
wa_bdc_error-m_text = 'Not able to open the job'.
APPEND wa_bdc_error TO int_bdc_error.
EXIT.
ENDIF.

* Submit step required to initiate job
SUBMIT rsbdcsub AND RETURN
USER sy-uname
VIA JOB l_jobname NUMBER l_jobnumber
WITH mappe = l_jobname
WITH von = sy-datum
WITH bis = sy-datum
WITH z_verarb = 'X'.


IF sy-subrc NE 0.
wa_bdc_error-m_type = 'E'.
wa_bdc_error-m_text = 'Job run fail'.
APPEND wa_bdc_error TO int_bdc_error.
EXIT.
ENDIF.

* Submit the background job using 'JOB_CLOSE'
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
jobcount = l_jobnumber
jobname = l_jobname
strtimmed = 'X'
IMPORTING
job_was_released = l_job_released
EXCEPTIONS
invalid_startdate = 01
jobname_missing = 02
job_close_failed = 03
job_nosteps = 04
job_notex = 05
lock_failed = 06
OTHERS = 99.

IF sy-subrc NE 0.
wa_bdc_error-m_type = 'E'.
wa_bdc_error-m_text = 'Job run fail'.
APPEND wa_bdc_error TO int_bdc_error.
EXIT.
ENDIF.


ENDFORM. " execute_session

here are the links which will have other smaple programs

http://www.sap-img.com/abap/program-loads-the-material-assignment-of-routings.htm

http://www.guidancetech.com/people/holland/sap/abap/yusermod.htm

http://www.guidancetech.com/people/holland/sap/abap/zutbdcer.htm

http://www.sap-img.com/abap/learning-bdc-programming.htm

regards,

pankaj singh

<b>***** reward poitns if helpful</b>

Read only

former_member2382
Active Participant
0 Likes
393

Hi All..

Can anybody tell me about the interfaces that we have in SAP.

Regards,

Parvez.