12-21-2006 12:36 AM
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
12-21-2006 1:31 AM
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
12-21-2006 12:50 AM
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
12-21-2006 1:01 AM
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
12-21-2006 1:08 AM
Hi Will,
Can you create two different BDC session names instead of only one session?
Let's say GROUP and GROUP2.
Regards,
Ferry Lianto
12-21-2006 1:16 AM
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
12-21-2006 1:31 AM
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
12-21-2006 1:39 AM
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
12-21-2006 1:42 AM
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.
12-21-2006 1:50 AM
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
12-21-2006 2:16 AM
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
12-21-2006 2:28 AM