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: 

IDOC Segment Data element Problem

itabhishek9
Participant
0 Kudos

Hi SDNites,

I have created a custom segment for a custom IDOC and the details of this segment has to be shown in the ALV with field headers having the description corresponding to data element used for IDOC segment fields. But when the segments are created as a structure all the data elements are changed to char automatically so my column header descriptions are coming

4 REPLIES 4

Former Member
0 Kudos

Hi Abhishek Gupta

you question is not clear... Explain in clear way....

Thanks

Ramesh

itabhishek9
Participant
0 Kudos

Hi,

Reiterating my question,

Whenever we create an IDOC segment using WE31, a structure gets created in SE11. But this structure doe not contains the data element used in We31. Inspite of that fields are associated with Char types.

When these segments are used to display in ALV, the description does not come up as they are associated with char types. I have a lot of segments in my pgm which are displayed in ALV. Is there a simpler way to get the description in ALV.

Regards,

Abhi

0 Kudos

Hi,

Use the FM IDOC_COMPLETE_SEGMENT_READ. You will get desc and feild lenght info.

Then populate field catalogue manually. inorder to show the descriptions.

Regards,

Shanmugavel Chnadrasekaran

0 Kudos

That's where in the good old days SAP used to generate several dictionary structures. The <b>E1</b> structure was used for filling the actual IDoc, so had to consist only of character-type fields. However, then there were also corresponding <b>E2</b> (segment definition) and <b>E3*</b> (segment documentation) structures defined, which contained the relevant information. This doesn't happen any longer, but you can see that for example when looking at E1MARAM, E2MARAM does have the information you need.

Anyhow, nowadays those (superfluous) additional dictionary structures are no longer generated and segment information field information is stored in table EDSAPPL. However, in general you're probably better off to utilize a function module (as indicated by previous poster) in case you worry about versioning.

However, instead of using function module IDOC_COMPLETE_SEGMENT_READ, I'd use SEGMENT_READ_COMPLETE, because the latter is released. Should you need complete IDoc information use IDOCTYPE_READ_COMPLETE.

Cheers, harald