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 steps differ when inputing same record with different other field value

Former Member
0 Likes
962

CODEDATE--


ETC...(there is of course other field)

11----01.10.2007 (do process A C D)

12----01.10.2007 (do process A C D)

12----01.11.2007 (Having same code field so do process A B C D)

13----01.11.2007 (do process A C D)

14----01.10.2007 (do process A C D)

15----01.11.2007 (do process A C D)

15----01.12.2007 (Having same code field so do process A B C D)

16----01.10.2007 (do process A C D)

hi i am doing a BDC batch my input table a bit like above.

first record will do process A C D

second record will do process A C D

thirt record will do process A B C D

second record will do process A C D

Any hint of how i can do that plzzzz . Urgent helppp needed

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
949

After process A, whenever you encounter a duplicate code, you execute process B.

Rob

9 REPLIES 9
Read only

Former Member
0 Likes
949

as per understanding,

if code = 11 and date = 01.10.2007 then u need process A C and D right.

define 4 subrountine with A B C D logics.

define one more subroutine with SR1 and SR2.

inside SR1 call 3 subroutines A C D

and SR2 call A B C D.

if code = 11 and date = 01.10.2007 then

call subroutine SR1,

if if code = 12 and date = 01.11.2007 then call Subroutine SR2.

if u have any issue, let me know the detailed requirement.

Read only

0 Likes
949

i won't know what i will have in my table in advance

Read only

Former Member
0 Likes
950

After process A, whenever you encounter a duplicate code, you execute process B.

Rob

Read only

0 Likes
949

ok for code i execute the step B in addition

but how do i check for the duplicate record be setting a flag or something

Read only

0 Likes
949

As you loop through the table, you can keep track of the previous code. If it's the same, process B.

Rob

Read only

0 Likes
949

how do you keep track of the previous code . i am quite new to BDC

Read only

0 Likes
949

Well, it's not BDC, it's just ABAP. You can do something like:

DATA: old_code LIKE itab-code.

LOOP AT itab.
* Process A
  IF old_code = itab-code.
*   Process B
  ENDIF.
* Process C
* Process D
  old_code = itab-code.
ENDLOOP.

If you don't like to keep track of the code, you can use the AT NEW command.

Rob

Read only

Former Member
0 Likes
949

Hi,

Do it in a synchronous Mode. By default it will be asynchronous mode. Otherwise it will through you an error message like the transaction is locked.

Regards,

Satish

Read only

0 Likes
949

euhhhh what do you meen by asycronous mode or syncronous mode.

i am doing a batch input

perform open_BDC

perform dynpro

perform field

perform dynpro

perform field

perform close_BDC