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

Fill customer segment using the BD21

Former Member
0 Likes
831

Hi,

i have enhanced the base IDOC MATMAS05 by creating a customer segment. This segment has to be filled whenever the IDOC is transmitted by the BD21. But I don´t know how to enhance the BD21 without changing the standard. Is there an user-exit i can use?

May be someone can help me.

Greetings

Christian

3 REPLIES 3
Read only

roger_gomez
Active Participant
0 Likes
595

Hi Christian,

You have to enhance your MATMAS Idoc in BD21 in customer-exit EXIT_SAPLMV01_002 (INCLUDE ZXMGVU03).

Reward points if useful.

Roger

Read only

0 Likes
595

Hi Roger,

Thank you for answer. I found the INCLUDE and tried to fill my segment with the following code:

DATA: lw_edidd01   TYPE edidd,
      lw_ZMATFIL TYPE ZMATFIL.
IF message_type EQ 'MATMAS'  AND
   segment_name EQ 'ZMATFIL'.
  
  LOOP AT idoc_data INTO lw_edidd01
                          WHERE segnam EQ 'ZMATFIL'.

          MOVE:  lw_edidd01 to lw_ZMATFIL, 
                 F_MVKE-VKORG TO lw_ZMATFIL-VKORG, 
                 lw_ZMATFIL TO lw_edidd01-sdata. 
          MODIFY: idoc_data FROM lw_edidd01 TRANSPORTING sdata.
  ENDLOOP.
endif.

So I started the BD21 with "MATMAS"!

But the "move"-statement is never reached because "segment_name " never becomes ZMATFIL.

So the IDOC was created. But when I looked for it in the WE02 it says "EDI Syntax error". Because my segment is marked as necessary.

Edited by: Christian Dsen on Mar 6, 2008 1:29 PM

Read only

Former Member
0 Likes
595

Hi,

I have a similar issue. We have extended the MATMAS message type with a new segment for export data.

When we change the export data in MM02, it creates a change document (standard SAP).

Yet when I run BD21, it does not create a change pointer and fill that custom segment.

Any help is appreciated.

Thanks.

JP