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: 

Program for Creating IDoc Segment

Former Member
0 Kudos
212

Hi experts,

What FM should I use in my program to create/insert a segment in a BASIC TYPE?

Please provide me the code/logic for that FM.

Thanks in advance.

1 ACCEPTED SOLUTION

Former Member
0 Kudos
155

Hi Sirisha,

I don't think there is any FM. You need to do it in program.

Regards,

Atish

8 REPLIES 8

Former Member
0 Kudos
156

Hi Sirisha,

I don't think there is any FM. You need to do it in program.

Regards,

Atish

0 Kudos
155

Hi,

Actually i need to create a userexit for outbound delivery to include some additional item text header & detail for which iam using the segments E1TXTP8 & E1TXTP9.

So I need to create E1TXTP8 segment with TDID & E1TXTP9 segment with text .

Please help me with this problem.

Thanks in advance.

0 Kudos
155

Hi sirisha namani,

I suppose you are using function module IDOC_OUTPUT_DELVRY creating your outbound IDoc.

First, there is a BADI which allows you to check and/or extend the delivery data before they are mapped into IDoc segments:


* User-Exit for raw-data manipulation before Mapping
  perform exit_badi_v56k.         
    call method ref_to_badi_v56k->raw_data_manipulation
      exporting
        control_record_in = control_record_in
      changing
        vttk              = vttk
        ttds              = ttds
        tab_vttp          = tab_vttp[]
        tab_vtts          = tab_vtts[]
        tab_vtsp          = tab_vtsp[]
        tab_vbpa          = tab_vbpa[]
        tab_vtpa          = tab_vtpa[]
        tab_vekp          = tab_vekp[]
        tab_vepo          = tab_vepo[]
        tab_likp          = tab_likp[]
        tab_lips          = tab_lips[]
        tab_vbak          = tab_vbak[]
        tab_vbap          = tab_vbap[]
        tab_vblb          = tab_vblb[]
        tab_eikp          = tab_eikp[]
        tab_eipo          = tab_eipo[]
        tab_vbkd          = tab_vbkd[]
        tab_vekp_smg      = tab_vekp_smg[].                   "n_678875

This may be easier as you don't have to modify the IDoc segment data in EDIDD-SDATA - this is sometimes a real task as you have to care for proper numbering of segments and can not address the segment fields directly.

The second opportunity is an exit function called at the end of the mapping process:


 FU EXIT_SAPLV56K_002                                                                                
____________________________________________________                                                                                
Text                                                                                
Transmit Shipments to IDOC Type                                                                                
Functionality                                                                                
This function module is a user exit within IDoc outbound processing for    
     shipments. The callup of this function module is programmed for each       
     enhancement of the internal table for the IDoc (in other words, when you   
     add an extra segment). This means that when the callup is active, the      
     system makes all application data (for example, shipment header,           
     shipment items and so on) and the previously generated IDoc available in   
     this function module.                                                                                
You can store your own coding within this function module. This coding     
     can add your own data to the internal table for the IDoc, or can change    
     data already present in the table.                                         

The text is from documentation of the function.

Addition:

Create a project with CMOD, use enhancement V56K0001 (Outbound Transportation Output (EDI)); create the include in function module EXIT_SAPLV56K_002, start coding...

And then activate project. Good luck!

Regards,

Clemens

Message was edited by:

Clemens Li

0 Kudos
155

Hi Clemens,

Thank you for ur information.

I am using the second opportunity which is an exit function called at the end of the mapping process:

FU EXIT_SAPLV56K_002 .

I have to write the code in user exit to create additional item text header & detail segments to include different texts. So I want to know how to create the E1TXTP8 & E1TXTP9 segments in User exit with different text header & detail.

Please tell me how to proceed in this.

Thanks in advance.

0 Kudos
155

Hi sirisha,

just roughly: You loop at the EDIDD table passed to function module. At the record, you want to insert a segment, you insert a line in the table. Copy the existing data of the preceeding record. Add 1 to SEGNUM; change SEGNAM to E1TXTP8. prepare a local field of type E1TXTP8 with the header text data. Move this into component SDATA of the record. All subsequent SEGNUMS must be increases by one to keep the intergrity.

The same applies for E1TXTP9 at item level.

Regards,

Clemens

0 Kudos
155

Hi,

I am unable to understand ur resolution as I am newbie to ABAP. Could u plz explain me in brief if possible with code. Its very urgent , I am waiting for ur reply.

Thank You.

0 Kudos
155

Hi again,

Here is in the pseudo code fin the user exit for which iam looking for

"Create E1TXTP8 segment with TDID."

Thanks.

0 Kudos
155

Hi,

DATA: WA_E1TXTP8 LIKE E1TXTP8.

LOOP AT INT_EDIDD WHERE SEGNAM = 'E1TXTP8'.

WA_E1TXTP8 = INT_EDIDD-SDATA.

WA_E1TXTP8-TDline =<value>.

INT_EDIDD-SDATA = WA_E1TXTP8 .

MODIFY INT_EDIDD.

EXIT.

ENDLOOP.