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: 

custom Segment is not appearing in orders05

Former Member
0 Kudos

Hi ,

I am trying to extend IDOC type ORDER05.I have followed all the steps But even then segment is not appearing after i generate IDOC and test in we02.

The two fields has to extended in EKKO and same has to extened in ORDER02 at the time PO creation.

This is the requirement. Right now iam not passing any data in the custom segment but i have done all the initial configuration..

Idoc also generated succssfully..but its having my custom segment..Pls advice

11 REPLIES 11

Former Member
0 Kudos

The outbound ORDERS IDoc is created from PO output by standard EDI function IDOC_OUTPUT_ORDERS

When you add a new custom Z segment you should also append the segment, in a user exit, at the correct level (as per IDoc definition in WE30)

SE37 -> IDOC_OUTPUT_ORDERS -> perform fuellen_idoc_inttab. -> perform customer_function. -> user exit CALL CUSTOMER-FUNCTION '002' -> EXIT_SAPLEINM_002.

Here you can append your Z segment below the standard segment as you defined in WE30

Sample logic, here I am appending custom ZEDP01 segment below E1EDP01 segment

IF int_edidd-segnam EQ 'E1EDP01'.
    CLEAR int_edidd.
    MOVE xekpo-matnr TO i_z1edp01-matnr.
    MOVE 'Z1EDP01' TO int_edidd-segnam.
    MOVE i_z1edp01 TO int_edidd-sdata.
    APPEND int_edidd.
  ENDIF.

0 Kudos

HI,

If i go in to that FM there is a include but I am not able to double click that .Its not going inside..Moreover if I create idoc this is not triggered .Pls suggest.

0 Kudos

Yes, that include need to be created. By double clicking on it you will get a prompt to create the object (provided you have developer access), choose yes and you should be able to create the include and put a break point on it.

In IDOC_OUTPUT_ORDERS function module that creates the outbound ORDERS05 IDoc.

--> EXIT_SAPLEINM_002 will be called repeatedly for each IDoc segment while the IDoc is still building

--> EXIT_SAPLEINM_011 will be called once for the whole IDoc, once SAP finished building it

So yes, you can use any of these user exits to manipulate the output IDoc.

Also, the break point won't get triggered when output type is set to trigger immediately (dispatch time 4) when you issue the output from ME22N / ME23N, because the IDoc will be triggered asynchronously in this mode by the system and not in your session, so your session break points are ineffective.

What you need to do is go into the ME22N output page (Click Messages on ME22N screen, select the condition type in yellow color (not yet processed), click on "Further data"and set "Dispatch time" to 1 (Send with periodically schedule job). After doing this issue the output (by saving the PO etc). This will mean that the output IDoc is not triggered immediately.

Now put the break point in the suggested user exit.

Come to SE38 and execute RSNAST00 program, give "Output application" as "EF", object key as your PO number (format it with leading zeros for full 10 digits) and enter your output type. Run it and then you will see that your break point is hit.

0 Kudos

Thanks a lot guru.But I have tried populating the code in both the exit but after i generate the idoc and put that idoc in we02 the custom segment is not showing up ..But I need to check as per your comments to debug it.But my question is if the code is correct surely the data will be showin in we19 rite .pls throw some idea..

0 Kudos

Hi One more question .I want in the transaction me21n also while creating a purchase order..so can i use the same exit whatever u have suggested

0 Kudos

ME21N and ME22N both will call the user exit provided you create the output ORDERS IDoc using IDOC_OUPUT_ORDERS function module.

0 Kudos

Thanks a lot guru..Full points for you

0 Kudos

Hi Vishnu,

Your complete and straight response lead me to find the solution.

Thanks for sharing,

César Schecl

Former Member
0 Kudos

Have u written the code in USER-EXIT to populate your custom segment???

mithun_shetty4
Contributor
0 Kudos

Once u extend the IDOC ! u need to fill the extended fields / segments with Values.U can fill this values though an User Exit .

Find the function module in the outbound function module which is attached to the Process code 'ME10' i guess you are using ME10 .

Regards,

Mithun Shetty

former_member186077
Active Participant
0 Kudos

Hi,

You need to code in the user exit to populate the extended segment in the idoc.

Also you need to define the idoc extension in the partner profile definition.

Thanks and Regards,

Sriranjani Chimakurthy.