Application Development 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: 

Timing issues with processing 2 BDCs in 1 program

Former Member
0 Kudos

Hi,

I am having a timing issue when working with BDCs. I have the 2 following statements in my program to created 2 BDCs.

SUBMIT RSBDCSUB

WITH MAPPE EQ GROUP

WITH VON EQ SY-DATUM

WITH BIS EQ SY-DATUM

WITH FEHLER EQ SPACE

EXPORTING LIST TO MEMORY

AND RETURN.

For some reason, the BDC sessions are not processing automatically. I would have to manually process them from SM35. Would it be OK to do this? If not what other approaches should I do to get the 2 BDCs to process automatically in 1 program.

Would I have to create 2 programs to do the BDCs automatically.

Thanks

Will

1 ACCEPTED SOLUTION

ferry_lianto
Active Contributor
0 Kudos

Hi Will,

Sorry ... I did not know that you are using generated program BDCRECX1.

In this case, it would be easier and quicker to create two separate program while using the same include program to process two different BDC session. You are correct as you suggested in the beginning.

Otherwise, you need to copy program BDCRECX1 and modify accordingly.

Regards,

Ferry Lianto

10 REPLIES 10

ferry_lianto
Active Contributor
0 Kudos

Hi Will,

You need to submit RSBDCSUB twice for two different BDC session.


SUBMIT RSBDCSUB
   WITH MAPPE EQ GROUP
   WITH VON EQ SY-DATUM
   WITH BIS EQ SY-DATUM
   WITH FEHLER EQ SPACE
   WITH Z_VERARB EQ 'X'                      <--- add this line
   EXPORTING LIST TO MEMORY
   AND RETURN.

SUBMIT RSBDCSUB
   WITH MAPPE EQ GROUP2
   WITH VON EQ SY-DATUM
   WITH BIS EQ SY-DATUM
   WITH FEHLER EQ SPACE
   WITH Z_VERARB EQ 'X'                      
   EXPORTING LIST TO MEMORY
   AND RETURN.

Regards,

Ferry Lianto

0 Kudos

Hi Ferry,

I have the following sequence of processing.

1. Check the table Z to see if there are sets created have been created before

2. If there are sets then delete the sets using the BDC

3. Submit BDC

4. Refresh the Z table uisng SQL Native TRUNCATE

5. Create sets

6. Update Z table with sets just created

7. Submit BDC

I kept getting a runtime error that there are records in the Z table, and the BDCs are still in SM35. I tried adding the statement you have suggested and it seem that the BDC are not procesisng automatically.

Would you think I have to separate the 2 BDC procesess into 2 programs. When I run the progranj I gave only 1 session name.

Thanks

Will

ferry_lianto
Active Contributor
0 Kudos

Hi Will,

Can you create two different BDC session names instead of only one session?

Let's say GROUP and GROUP2.

Regards,

Ferry Lianto

0 Kudos

Hi Ferry,

I tried that and there was an error saying that the Field GROUP1 is unknown but there is a field GROUP. I am using the INCLUDE BDCRECX1 that I created when I did the recording in SM35.

Thanks and Regards,

Will

ferry_lianto
Active Contributor
0 Kudos

Hi Will,

Sorry ... I did not know that you are using generated program BDCRECX1.

In this case, it would be easier and quicker to create two separate program while using the same include program to process two different BDC session. You are correct as you suggested in the beginning.

Otherwise, you need to copy program BDCRECX1 and modify accordingly.

Regards,

Ferry Lianto

0 Kudos

Hi Ferry,

That's all right. Thanks for your help. I am thinking I should try to use one program.

I will post another message to ask for the code for creating the GROUPS and not use the standard INCLUDE.

Thanks and regards

Will

0 Kudos

Hi Ferry I tried to close this message by awarding you 10 points that this issue is resolved but it filled the other points . Something changed form this site.

0 Kudos

Hi Ferry,

I tried to copy the code to a Z include. What would I have to change to solve the GROUP1 and GROUP2? Hope it is OK to resolve hti sissue form this thread.

Thanks and regards,

Will

ferry_lianto
Active Contributor
0 Kudos

Hi Will,

Sorry ... I don't have SAP system now.

But you could do something like this.


data: wa_group(12).

wa_group = 'GROUP1'.

call function 'BDC_OPEN_GROUP'
   EXPORTING
      client = sy-mandt
      group  = wa_group
      user   = sy-uname
      keep   = X'.

Do perform BDC_INSERT.

Do perform BDC_CLOSE_GROUP.

...

wa_group = 'GROUP2'.

call function 'BDC_OPEN_GROUP'
   EXPORTING
      client = sy-mandt
      group  = wa_group
      user   = sy-uname
      keep   = X'.

Do perform BDC_INSERT.

Do perform BDC_CLOSE_GROUP.

...

Regards,

Ferry Lianto

0 Kudos

Hi Ferry,

Thanks. I will try that.

Regards

Will