Skip to Content
author's profile photo Former Member
Former Member

BADI Implementation for distributing customer master through ALE

Hi,

I have implemented the BADI definition CUSTOMER_ADD_DATA_BI for populating the custom segment Z1KNA1M(contains the additional address fields) of the idoctype Debmas06 in the method FILL_ALE_SEGMENTS_OWN_DATA.

It was working fine till I introduced other filter based on the country of the customer in the segment E1KNA1M - Land1 (US, MX, CA) in the distribution model.

Now it's working fine for the customers with the above countries, but for the other countries where in it shloudn't generate a communication idoc it's giving an error saying 'Internal error: Program read table idoc_structure, command data_select_for_block, argument Z1KNA1M'. when running BD21 or BD12.

Would appreciate for your responses.

Thankyou,

Nalinikalyan.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

7 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Feb 15, 2008 at 01:35 PM

    Hi kalyani,

    Could u pls help on this...

    I am using badi CUSTOMER_ADD_DATA_BI to post custom segments data to database( here my fm is configured or calling this badi based upon partner profiles)

    Here i want to receive custom segment & corresponding sdata then i need to submit this to E_BI_STRUCT (According to my knowledge if we submit to e_bi_struct sap will take care of bdc)

    But i see method MODIFY_BI_STRUCT_FROM_STD_SEG not importing custom segments and method PASS_NON_STANDARD_SEGMENT has no exporting or changing parameter.

    I want custom segments data to be submitted using this badi itself.

    So kindly please suggest to solving this issue.

    Your help highly appreciated.

    Thanks in advance.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Nalini Kalyan is right.

      You may capture the custom segment data which exists in I_SEGMENT_DATA in PASS_NON_STANDARD_SEGMENT method to an internal table.

      considering the custom segment as 'ZABCDEFGH'

      IF I_SEGMENT_NAME = 'ZABCDEFGH'

      APPEND I_SEGMENT_DATA TO ITAB.

      ENDIF.

      i.e read the segment_name and capture the data in an internal table and can be used to populate T_BI_DATA in FILL_BI_TABLE_WITH_OWN_SEGMENT .

      Hope this helps.

  • author's profile photo Former Member
    Former Member
    Posted on Feb 13, 2008 at 07:56 PM

    Got the answer as the Extension need to be passed in the BADI,Which is not passed in at first.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 28, 2008 at 06:13 PM

    Hi Kalyani ,

    I am getting the same error -

    'Internal error: Program read table idoc_structure, command data_select_for_block, argument Zemail .' when running BD21 /BD14

    I added a custom segement to the Cremas03 Idoc type.

    What did you do to solve this?

    What do you mean by adding the extension ?

    thanks,

    Preeta

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 01, 2011 at 10:39 AM

    Hello Nalini,

    I have a similar requirement where i added a new field in KNB1 table and this data is sent through DEBMAS06 to another SAP system. Hence i need to pass this additional data also to the other system.

    I have created an extension for DEBMAS06 and added a custom segment to it. Now I want to use CUSTOMER_ADD_DATA_BI to pass the custom segment data also.

    How to achieve this i.e in which all methods do I need to include code to send the additional data?

    Request you to guide me to do the following.

    Regards,

    Chandra

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 15, 2011 at 12:04 PM

    Hi kalyani,

    Can you tell me How do you have implemented the method FILL_ALE_SEGMENTS_OWN_DATA?

    I try to do it but i don't find the solution.

    Thanks a lot !!

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Sep 20, 2011 at 12:11 PM

    Hi Nalini,

    Could you help in populating Z segment (ZTAX) which is added to the ZDEBMAS07 (copied from DEBMAS07).

    This segment is added at very last and I only can see sinle method FILL_ALE_SEGMENTS_OWN_DATA in BADI CUSTOMER_ADD_DATA_BI. But not getting logic how can I populate this locating it very last of the tree.

    Its easy for me to put it say after E1KNA1M or after E1KNA11. Please show something if you can.

    Code what I have written still is:

    TYPES: BEGIN OF ty_j_1imocust,

    j_1icstno TYPE j_1imocust-j_1icstno,

    j_1ilstno TYPE j_1imocust-j_1ilstno,

    END OF ty_j_1imocust.

    DATA: ls_j_1imocust1 TYPE ty_j_1imocust.

    DATA: lv_kunnr TYPE kna1-kunnr,

    ls_t_idoc_data TYPE edidd.

    DATA: lv_flag TYPE char1.

    DATA: lv_j1icstno TYPE j_1imocust-j_1icstno,

    lv_j1ilstno TYPE j_1imocust-j_1ilstno.

    DATA: ls_edidd TYPE edidd.

    DATA: ls_j_1imocust TYPE j_1imocust.

    CLEAR ls_t_idoc_data.

    READ TABLE t_idoc_data INTO ls_t_idoc_data WITH KEY segnam = 'E1KNA1M'.

    IF sy-subrc = 0.

    lv_kunnr = ls_t_idoc_data-sdata+3(10).

    ENDIF.

    CLEAR ls_t_idoc_data.

    READ TABLE t_idoc_data INTO ls_t_idoc_data WITH KEY segnam = 'ZTAX'.

    IF sy-subrc = 0.

    DELETE t_idoc_data INDEX sy-tabix.

    ENDIF.

    CLEAR ls_j_1imocust.

    SELECT SINGLE *

    FROM j_1imocust INTO ls_j_1imocust WHERE kunnr = lv_kunnr.

    IF sy-subrc = 0.

    MOVE ls_j_1imocust-j_1icstno TO ls_j_1imocust1-j_1icstno.

    MOVE ls_j_1imocust-j_1ilstno TO ls_j_1imocust1-j_1ilstno.

    ls_edidd-mandt = sy-mandt.

    ls_edidd-segnam = 'ZTAX'.

    ls_edidd-sdata = ls_j_1imocust1.

    APPEND ls_edidd TO t_idoc_data.

    ENDIF.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 16, 2020 at 04:35 PM

    In the FM MASTERIDOC_CREATE_<Message type name>, Enhancement has to be implemented.

    Add the the IDoc Extension Name has to be passed to the CIMP field of the structure 'F_IDOC_HEADER'. for eg. if your IDoc Extension name is 'Z_IDOC_EXTEND' the code would be :

    F_IDOC_HEADER-CIMP = 'Z_IDOC_EXTEND'.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.