Skip to Content
0
Former Member
Sep 22, 2005 at 06:46 PM

BDCDATA for include ZXVEDU04 of EXIT_SAPLVEDA_002?

1321 Views

I am attempting to write my first user exit for an Inbound IDoc. Outbound seems easy by comparison. I am going to add a date to VBAK-MAHDT from an extended ORDERS03 segment. The new IDoc type is called 'Z_EK_ORDERS03' and my extended segment is pretty much like E1EDK03.

I'm working with enhancement VEDA0001. For include ZXVEDU03 of component EXIT_SAPLVEDA_001 I have this so far:

DATA:

w_z1edk03 LIKE z1edk03,

w_vbak LIKE vbak.

IF contrl-mestyp = 'ORDERS' AND

contrl-idoctp = 'Z_EK_ORDERS03'.

CASE segment-segnam.

WHEN 'Z1EDK03'.

IF segment-sdata(3) = 'Z01'.

w_z1edk03 = segment-sdata.

MOVE dxvbak TO w_vbak.

w_vbak-mahdt = w_z1edk03-datum.

MOVE w_vbak TO dxvbak.

ENDIF.

WHEN OTHERS.

ENDCASE.

ENDIF.

Now I need to insert the date into the right screen using include ZXVEDU04 of EXIT_SAPLVEDA_002. I have this so far:

DATA:

x_bdc LIKE bdcdata OCCURS 0,

w_vbak LIKE vbak,

w_bdc TYPE bdcdata,

i_bdc TYPE I.

MOVE dxbdcdata TO w_bdc.

IF w_bdc-fnam EQ SPACE.

i_bdc = sy-tabix - 1.

READ TABLE dxbdcdata INDEX i_bdc.

MOVE dxbdcdata TO w_bdc.

ENDIF.

IF w_bdc-fnam = 'BDC_OKCODE' AND

w_bdc-fval = 'SICH'.

CLEAR w_bdc.

LOOP AT dxbdcdata INTO w_bdc.

APPEND w_bdc TO x_bdc.

CASE w_bdc-fnam.

WHEN 'VBKD-BSTKD'.

MOVE dxvbak TO w_vbak.

IF NOT w_vbak-mahdt IS INITIAL.

w_bdc-fnam = 'VBAK-MAHDT'.

w_bdc-fval = w_vbak-mahdt.

APPEND w_bdc TO x_bdc.

ENDIF.

WHEN OTHERS.

ENDCASE.

ENDLOOP.

dxbdcdata[] = x_bdc[].

ENDIF.

This gives me an error of 'VBAK-MAHDT does not exist for screen 4001'. Do I have to add BDC records for screen '4351'? If I do what would the OPCODE be? Is there an easier way to accomplish my goals rather than using BDC at all?