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

IDOC Extension problem

Former Member
0 Likes
3,213

1. Created new segment with 2 fields in WE31.

2. Created new extension based on DELFOR01 and added my new segment from step 1 to it in WE30.

3. In WE82 I added a new entry with Message type DELINS, Basic Type delfor01, and my extension from step 2.

4. In CMOD I created an enhancement project and activated the user exit.

5. code from SE38:

data: segprice type zxxxxx,

case int_edidd-segnam.

when 'E1EDK09'.

clear int_edidd.

int_edidd-segnam = 'Zxxxx'.

segprice-field1 = xekko-xxxxx.

segprice-field2 = xekpo-xxxxx.

move segprice to int_edidd-sdata.

append int_edidd.

endcase.

Everything works great to this point.

My segment shows up when i look at it in BD87, and the data is as expected.

Problem is the structure is flat. When my segment is present all idoc hierarchy is flattened, which causes syntax errors. Any help is greatly appreciated, I have been working on this for several weeks and found nothing.

structure should be

->E1EDK09 level 1

E1EDKA1 level 2

Zxxxxxx custom segment level 2

->E1EDP10 level 2

E1EDP16 level 3

The structure with my segment is

E1EDK09 level 1

E1EDKA1 level 1

Zxxxxxx custom segment level 1

E1EDP10 level 1

E1EDP16

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,648

Where are you expecting the custom segment? The code you provded appears to attempt to place it immediately after E1EDK09, but you list it after E1EDKA1 at the end of your post.

Versioning can cause syntax errors. You'll notice segments are released per a specific SAP version. If the Seg. release in IDoc type is set to another version, the syntax check will fail.

FYI - Any time a syntax error occurs, the resulting IDoc is displayed without its hierarchical format.

18 REPLIES 18
Read only

Former Member
0 Likes
2,649

Where are you expecting the custom segment? The code you provded appears to attempt to place it immediately after E1EDK09, but you list it after E1EDKA1 at the end of your post.

Versioning can cause syntax errors. You'll notice segments are released per a specific SAP version. If the Seg. release in IDoc type is set to another version, the syntax check will fail.

FYI - Any time a syntax error occurs, the resulting IDoc is displayed without its hierarchical format.

Read only

0 Likes
2,648

The segment needs to be at level 2. In WE30 it is the first child segment of E1EDK09. From that, it looks like it was added in the order it shows up in the map.

The version for Message type DELINS basic type DELFOR01 is 30A. The entry I made to add my extension was 30A as well. Is that what you are refering to?

Since the flat hierarchy does not appear to indicate an issue, here are the exact errors:

1. The segment Zxxxx does not occur at the current level of the basic type DELFOR01 (extension ).

2. The segment group E1EDP10 has the attribute 'Mandatory' in the syntax description of the basic type DELFOR01 (customer enhancement ).

3. The segment E1EDKA1 has the attribute 'Mandatory' in the syntax description of the basic type DELFOR01 (customer enhancement ).

Both E1EDP10, and E1EDKA1 exist with data in the data records folder in BD87. Not sure why the syntax check thinks they are missing.

Something I have noticed in BD87, in the technical short info box where it lists basic type DELFOR01, Message Type DELINS, the extension field is blank. Should it not contain my extension name?

Read only

0 Likes
2,648

The missing extension might be the issue. Is the extension showing up in the control record, EDIDC-CIMTYP? Did you add the extension name to the partner profile entry for DELINS?

You do not need to populate anything beyond SEGNAM and SDATA when adding to the internal table.

Read only

0 Likes
2,648

BTW

I left out that I have added the extension to the partner profile. DELINS is listed as an outound parameter, and when you drill nito it, I have added my extension to the the extension field.

Read only

0 Likes
2,648

Have you been able to debug the user-exit? I think your IDoc is built by IDOC_OUTPUT_DELINS. Is that correct?

Read only

0 Likes
2,648

Yes, I can debug the exit. Everything is populating great, it is just that when my segment show up, the hierarchy goes to 0 for every segment that follows.

Read only

0 Likes
2,648

Is your extension name showing up in the structure CONTROL_RECORD_OUT?

Read only

0 Likes
2,648

I need to head out, but I'll check the thread again in the morning. Good luck.

Read only

0 Likes
2,648

No, it does not.

I pulled up the control record and all it has is Basic Type DELFOR01, Message Type DELINS. Extension and IDoc Type are blank.

Read only

0 Likes
2,648

To verify this is the issue, you could add a break-point to IDOC_OUTPUT_DELINS and update CONTROL_RECORD_OUT-CIMTYP immediately after PERFORM CALL_USEREXIT_FOR_CONTROL_REC.

I'll try to find out more regarding the extension. I assume you are using output determination for this. Is your output type set up to use RSNASTED as your processing program?

Read only

0 Likes
2,648

Try this:

1) Activate user-exit EXIT_SAPLEINM_001 in FORM call_userexit_for_control_rec.

2) Add a check for CONTROL_RECORD_OUT-RCVPRN = your desired external logical system.

3) If equal, set CONTROL_RECORD_OUT-CIMTYP to your extension.

Something like:


CHECK CONTROL_RECORD_OUT-RCVPRN = 'EXTSYSLS'.
MOVE 'ZEXTEN' TO CONTROL_RECORD_OUT-CIMTYP.

By the way, what output type are you using?

Read only

0 Likes
2,648

I activated the user-exit 001 and added the code to move my extension to the control record, but now my idoc will not generate. To verify, I removed the move and the idoc generated. Thoughts?

Read only

0 Likes
2,648

At this point I would start debugging. You should be able to turn off the syntax check in the partner profile as a temporary solution.

Have you tried creating the IDoc from WE19?

Read only

0 Likes
2,648

I run through the business process for testing.

I change the scheduling agreement and then process it in ME84

I found an error in ME84

No processing (error message ME 857) No message record found

This only occues when I have this line in

MOVE 'Zxxxxx' TO CONTROL_RECORD_OUT-CIMTYP.

Not sure why, but my breakpoints no longer work.

Read only

0 Likes
2,648

ME 857 is an ISO code error. Do you have any idea which field might trigger this? The only place I found this error was in FORM ISO_CODE_LANGUAGE in include LEINMF0U. This form is called in form FILL_SRV_BLAORD when populating segment E1EDCT3 (long text).

Read only

0 Likes
2,648

Turns out someone deleted my message control record. The move extension data to the control record fixed my problem.

Thanks!

Read only

0 Likes
2,648

Great news!

Read only

Former Member
0 Likes
2,648

Hi Jeff,

Welcome to SDN.

Please check the following sample codes (in bold) that you may need to add in your user exits to determine proper IDoc segment hierarchy/level.

CLEAR I_EDIDD.
I_EDIDD-MANDT  = SY-MANDT.
I_EDIDD-SEGNUM = '000001'.
I_EDIDD-SEGNAM = 'E1EDL20'.
<b>I_EDIDD-PSGNUM = '000000'.
I_EDIDD-HLEVEL = '02'.
I_EDIDD-DTINT2 = '1000'.</b>
I_EDIDD-SDATA  = L_E1EDL20.
APPEND I_EDIDD.

Hope this will help.

Regards,

Ferry Lianto