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

BDC Processing

Former Member
0 Likes
782

I need some help in finding some documentation or getting some information on BDC processing. We have some consultants in France helping us with a project and the developer is using BDC code like

FORM BDC_DYNPRO USING PROGRAM DYNPRO.

CLEAR BDCDATA.

BDCDATA-PROGRAM = PROGRAM.

BDCDATA-DYNPRO = DYNPRO.

BDCDATA-DYNBEGIN = 'X'.

APPEND BDCDATA.

ENDFORM.

FORM BDC_FIELD USING FNAM FVAL.

IF FVAL <> NODATA.

CLEAR BDCDATA.

BDCDATA-FNAM = FNAM.

BDCDATA-FVAL = FVAL.

APPEND BDCDATA.

ENDIF.

The above code is in a include module that is called by the main programs. I would to understand how this process works and what are the advantages and disadvantages of this type of coding. I am checking here in the forums, tying to narrow my searches to find any documentation, but so far no luck. If someone could point me in the right direction, that would be very helpful.

thanks in advance for the help.

I am trying to find some documentation in this to

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
734

It's basically like screen scraping. The system is entering data into program screens the same way a user would. As another person mentioned, good for automating repetitive tasks.

I see two primary advantages. First, you can be sure that the BDC program has all the functionality of whatever manual entry would normally achieve. For example, all the same authorization checks would be performed. Second, if you are trying to programatically enter data into an existing SAP screen and there is no equivalent function module, this lets you do that.

The disadvantage is that it is slower than other options like BAPIs. There's also a learning curve as it is hard to read until you become familiar with it.

Hope this helps,

Brett

7 REPLIES 7
Read only

suresh_datti
Active Contributor
0 Likes
734

>>The above code is in a include module that is called by the main programs.

This is the normal practice to avoid repetitive coding.. I don't see any disadvantage following this approach.

~Suresh

Read only

Former Member
0 Likes
734

"the advantages and disadvantages of this type of coding."

Over what other type of coding?

Rob

Read only

Former Member
0 Likes
734

This type of coding could be used to fill in screens in SAP automatically.

If you don't know what to pass of values. Then start transaction SM35 and do a recording of the action you want to automate.

Add is some source to make it clear voor you. It is source used for HR.

refresh BDCDATA.

  • Global

perform bdc_dynpro using 'SAPMP50A' '1000'.

perform bdc_field using 'BDC_OKCODE' '=INS'.

perform bdc_field using 'RP50G-PERNR' sap_pernr.

perform bdc_field using 'RP50G-TIMR6' 'X'.

perform bdc_field using 'RP50G-CHOIC' '0000'.

  • Infotype 0000

perform bdc_dynpro using 'MP000000' '2000'.

perform bdc_field using 'BDC_OKCODE' '=UPD'.

perform bdc_field using 'P0000-MASSN' rec_leaving-massn.

perform bdc_field using 'P0000-MASSG' rec_leaving-massg.

perform bdc_field USING 'P0000-BEGDA' rec_leaving-begda.

  • Infotype 0001

perform bdc_dynpro using 'MP000100' '2000'.

perform bdc_field using 'BDC_OKCODE' '=UPD'.

perform bdc_field USING 'P0001-BEGDA' rec_leaving-begda.

perform bdc_field USING 'P0001-ENDDA' rec_leaving-endda.

  • perform bdc_field USING 'P0001-ABKRS' '99'.

  • Infotype 0016

perform bdc_dynpro using 'MP001600' '2012'.

perform bdc_field using 'BDC_OKCODE' '/ENXT'.

  • Infotype 0008

perform bdc_dynpro using 'MP000800' '2000'.

perform bdc_field using 'BDC_OKCODE' '/ENXT'.

  • Infotype 0007

perform bdc_dynpro using 'MP000700' '2012'.

perform bdc_field using 'BDC_OKCODE' '/ENXT'.

  • Infotype 9304

perform bdc_dynpro using 'MP930400' '2000'.

perform bdc_field using 'BDC_OKCODE' '/ENXT'.

perform bdc_transaction using 'PA30'.

Read only

Former Member
0 Likes
735

It's basically like screen scraping. The system is entering data into program screens the same way a user would. As another person mentioned, good for automating repetitive tasks.

I see two primary advantages. First, you can be sure that the BDC program has all the functionality of whatever manual entry would normally achieve. For example, all the same authorization checks would be performed. Second, if you are trying to programatically enter data into an existing SAP screen and there is no equivalent function module, this lets you do that.

The disadvantage is that it is slower than other options like BAPIs. There's also a learning curve as it is hard to read until you become familiar with it.

Hope this helps,

Brett

Read only

Former Member
0 Likes
734

Hi Timothy,

the first subroutine is called to fix the program name and screen name.the second subroutine is used to pass a value to a particular field.As this part is common for all bdc programs, they might be using a common include for similar programs.

Hope this helps.

regards,

keerthi.