Module pool- only first line item data saved, rest disappears??

Hi Experts,
I have one module pool that was developed by other developer. It has header details input fields and items details input by table control.
Now below scenarios occur:
1) When I enter only one line item, and save it, the data is saved properly
2) when I enter more than one item data and save it, it only saves first line item data.
3).When I press ENTER button after every new line item data, it saves all the data properly.
I tried to debug the report but could not find the exact problem statement as the code is written very badly without any comments.
I am pasting the flow logic code below for the screen.
So please help me figure out the problem and solution for it.
+++++++++++++++++++++++++++++++++++
PROCESS BEFORE OUTPUT.
*&SPWIZARD: PBO FLOW LOGIC FOR TABLECONTROL 'IT_MSEG'
   MODULE it_mseg_change_tc_attr.
*&SPWIZARD: MODULE IT_MSEG_CHANGE_COL_ATTR.
   LOOP AT   it_gp
        INTO wa_gp
        WITH CONTROL it_mseg
        CURSOR it_mseg-current_line.
     MODULE it_mseg_get_lines.
*&SPWIZARD:   MODULE IT_MSEG_CHANGE_FIELD_ATTR
   ENDLOOP.
* MODULE STATUS_9001.
   MODULE deactive_screen.
PROCESS AFTER INPUT.
*&SPWIZARD: PAI FLOW LOGIC FOR TABLECONTROL 'IT_MSEG'
   LOOP AT it_gp.
     CHAIN.
       FIELD wa_gp-yposnr.
       FIELD wa_gp-matnr.
       FIELD wa_gp-maktx.
       FIELD wa_gp-meins MODULE check_uom ON INPUT..
*      FIELD WA_GP-DOC_QTY.
*      FIELD WA_GP-REC_QTY.
       FIELD wa_gp-gp_qty.
       FIELD wa_gp-chall_qty.
       FIELD wa_gp-netwr.
       FIELD wa_gp-remarks.
       FIELD wa_gp-exp_ret.
       MODULE it_mseg_modify ON CHAIN-REQUEST.
     ENDCHAIN.
     FIELD wa_gp-chk
       MODULE it_mseg_mark ON REQUEST.
   ENDLOOP.
   MODULE it_mseg_user_command.
*&SPWIZARD: MODULE IT_MSEG_CHANGE_TC_ATTR.
*&SPWIZARD: MODULE IT_MSEG_CHANGE_COL_ATTR.
   MODULE user_command_9001.
+++++++++++++++++++++++++++++++++++
Thanks,
Vishal.

Hi Aruna,
Below is the code as you required.
+++++++++++++++++++++++++++++
MODULE user_command_9001 INPUT.
   ygp_header_mas-ret_type = v_gpt.
   CASE sy-ucomm.
     WHEN 'MBLNR'.
       PERFORM select_mblnr.
     WHEN 'DEL'.
       PERFORM select_delivery.
     WHEN 'INTI'.
       PERFORM grt_gi_details.
     WHEN 'GENT'.
       PERFORM get_ge_details.
     WHEN 'GP'.
       PERFORM get_returnable_gp.
     WHEN 'SAVE'.
       PERFORM gen_gp_number.
       PERFORM gen_data.
       PERFORM save_data.
     WHEN OTHERS.
       PERFORM get_ge_details_other.
       IF it_gp[] IS INITIAL.
         INSERT INITIAL LINE INTO it_gp INDEX 1.
       ENDIF.
   ENDCASE.
   IF v_entry = 07 .
     PERFORM serial_no1.
     PERFORM insert_row.
   ENDIF.
   IF sy-ucomm IS INITIAL.
     PERFORM calc_amt.
   ENDIF.
   CLEAR:sy-ucomm.
ENDMODULE.                    "user_command_9001 INPUT
+++++++++++++++++++++++++++++++
MODULE it_mseg_user_command INPUT.
   ok_code = sy-ucomm.
   PERFORM user_ok_tc USING    'IT_MSEG'
                               'IT_GP'
                               'CHK'
                      CHANGING ok_code.
   sy-ucomm = ok_code.
ENDMODULE.                    "IT_MSEG_USER_COMMAND INPUT
++++++++++++++++++++++++++++++++++
MODULE it_mseg_modify INPUT.
   MODIFY it_gp
     FROM wa_gp
     INDEX it_mseg-current_line.
ENDMODULE.                    "IT_MSEG_MODIFY INPUT    
====> Above module has some problem i think as while debugging it was not updating IT_GP as the current line number was not matching with IT_GP as it has only one line item and WA_GP was changing. Also WA_GP data was getting changed with LOOP with all line items data.
++++++++++++++++++++++++++++++++++++++++++++++
MODULE it_mseg_mark INPUT.
   DATA: g_it_mseg_wa2 LIKE LINE OF it_gp.
   IF it_mseg-line_sel_mode = 1
   AND wa_gp-chk = 'X'.
     LOOP AT it_gp INTO g_it_mseg_wa2
       WHERE chk = 'X'.
       g_it_mseg_wa2-chk = ''.
       MODIFY it_gp
         FROM g_it_mseg_wa2
         TRANSPORTING chk.
     ENDLOOP.
   ENDIF.
   MODIFY it_gp
     FROM wa_gp
     INDEX it_mseg-current_line
     TRANSPORTING chk.
ENDMODULE.                    "IT_MSEG_MARK INPUT
+++++++++++++++++++++++++++++++++++++++++
If I press ENTER after entering each line item, all records come in IT_GP but if not then only first line item comes. Also if I dont press ENTER after entering the first line item and and add one item (total 2) and then press ENTER then sometimes both the lines disappear.
Thanks,
Vishal

Similar Messages

  • "read from measurement file" reads only first line of data

    Hello,
    I have a problem when trying to read a .lvm file through "Read from Measurements file" with the following block diagram
    Problem: it reads only the first line of data from what I can see in the probe window,.
    A part of the lvm file for reference.
    I haven't used Labview in a long long time, I'm trying to figure out what I am doing wrong.
    Thanks

    Sorry meant to attach the lvm. Here it is. (Actually I had to put it in .txt because the forum wont let me upload a lvm file)
    I unfortunately cannot share the full vi that record the data as I am not its owner/creator. I'll try to give as much info as I can with the relevant pictures attached, I hope it allows us to at least have an hint of where the problem might be.
    (this is in a while loop)
    In the stacked sequence, the other pannels are similar to the one shown here: value read fron a variable, converted to dynamic and a signal attribute is set. The "start recording" control operation is "switch when pressed".
    Here are the properties of the set signal attributes
    And here are the properties of the "write to measurement file"
    Attachments:
    NoTarget_full circle__Rx_-10-SAMPLE.txt ‏60 KB

  • Module Pool Programming adding line items.

    Hi,
    I am Doing Module Pool Programming in which I Should add line items and if the user gives the save button the data wil be saved in  tables and SAP should generate one unique number.
    Please give me inputs how to generate unique number and add n number of line items
    correct inputs are rewarded
    Thanks
    Rasheed.

    Hi,
    You may use Number Generator for generating unique ids in the system.
    The keyword DEFAULT SERIAL  gets a number generator for positive integers and can only be specified for columns that have the data type INTEGER, SMALLINT, and FIXED without decimal places (SERIAL).
    The first value generated by the generator can be defined by specifying an unsigned integer (must be greater than 0). If this definition is missing, 1 is defined as the first value.
    If an INSERT statement inserts the value in this column, you get the current number generator value and not the value 0.
    Each table may not contain more than one column with the DEFAULT specification DEFAULT SERIAL.
    Regards,
    Renjith
    Edited by: Renjith Michael on Oct 23, 2008 11:34 AM

  • In cor2, components only first line item should be in editalbe mode and res

    Dear friends,
    My client requirement is , in cor2 ie change process order, in components, Except line item 1. rest of all the components needs to be in display( grey) mode.
    As far as my knowledge,  with the option of Screen Variant , we can make all the components items grey But not one line item in editable mode and rest of all in grey mode.
    Please suggest a way out.

    Hi,
    A suggestion:
    Use one of the below user-exits to meet your need.
    PPCO0008  Enhancement in the adding and changing of components
    PPCO0023  Checks Changes to Order Components
    So the logic could be, if changes are done to any component except the first one, then prevent saving of the order. Discuss with your abaper & it shoudl be possible.
    I doubt with a screen variant this can be possible.
    Regards,
    Vivek

  • Line item data is not saving while creating a Sales order using Interactive

    Hi all,
    I am creating a sales order Using Interactive forms. In the form i am having Header data and line item data.I had created two structures one for Header data and one for Line item data. For entering  the LINE ITEM DATA i had created a Dynamic table with Buttons ADD ROW and DELETE ROW.
    User will Add the Row or Delete the Row based on the requirement.
    My issue is When ever the user clicks the SUBMIT button after entering the header data and 3 line items data , Sales order has been created with only first line item and the remaining two line items are not created.
    My Interactive form is like below
    HEADER DATA
    DOC_TYPE
    SALES_ORG
    DIST_CHN
    DIVISION
    PURCH_NO
    PARTN_ROLE
    PART_NO
    LINE ITEM DATA
                             ITEM_NO      MATERIAL          PLANT          QTY        COND_TYPE            COND_VALUE
    ADD ROW
    DELETE ROW
                                                                                    SUBMIT
    My  code for the method ONACTIONCLICK is like below
    method ONACTIONCLICK .
    data:
          Node_Adobe       type ref to If_Wd_Context_Node,
          Node_Zsaleheader       type ref to If_Wd_Context_Node,
          Elem_Zsaleheader       type ref to If_Wd_Context_Element,
          Stru_Zsaleheader       type If_Main=>Element_Zsaleheader,
          Node_Zsaleitem       type ref to If_Wd_Context_Node,
          Elem_Zsaleitem       type ref to If_Wd_Context_Element,
          Stru_Zsaleitem       type If_Main=>Element_Zsaleitem.
      data: header_data type BAPISDHEAD.
      data: item_wa type BAPIITEMIN.
      data: item_data type table of BAPIITEMIN.
      data: partner_wa type BAPIPARTNR.
      data: partner_data type table of BAPIPARTNR.
      data: sales_order type BAPIVBELN-VBELN.
      data: Errorlog type BAPIRETURN1.
    navigate from <CONTEXT> to <ADOBE> via lead selection
      Node_Adobe = wd_Context->get_Child_Node( Name = IF_MAIN=>wdctx_Adobe ).
    navigate from <ADOBE> to <Zsaleheader> via lead selection
      Node_Zsaleheader = Node_Adobe->get_Child_Node( Name = IF_MAIN=>wdctx_Zsaleheader ).
      Node_Zsaleitem = Node_Adobe->get_Child_Node( Name = IF_MAIN=>wdctx_Zsaleitem ).
    get element via lead selection
      Elem_Zsaleheader = Node_Zsaleheader->get_Element(  ).
      Elem_Zsaleitem = Node_Zsaleitem->get_Element(  ).
    get all declared attributes
      Elem_Zsaleheader->get_Static_Attributes(
        importing
          Static_Attributes = Stru_Zsaleheader ).
      header_data-DOC_TYPE = Stru_Zsaleheader-DOC_TYPE.
      header_data-SALES_ORG = Stru_Zsaleheader-SALES_ORG.
      header_data-DISTR_CHAN   = Stru_Zsaleheader-DISTR_CHAN.
      header_data-DIVISION = Stru_Zsaleheader-DIVISION.
      header_data-PURCH_NO = Stru_Zsaleheader-PURCH_NO.
      partner_wa-PARTN_ROLE   = Stru_Zsaleheader-PARTN_ROLE.
      partner_wa-PARTN_NUMB = Stru_Zsaleheader-PARTN_NUMB.
       append partner_wa to partner_data.
        Elem_Zsaleitem->get_Static_Attributes(
        importing
          Static_Attributes = Stru_Zsaleitem ).
      item_wa-ITM_NUMBER = Stru_Zsaleitem-ITM_NUMBER.
      item_wa-MATERIAL   = Stru_Zsaleitem-MATERIAL.
      item_wa-PLANT = Stru_Zsaleitem-PLANT.
      item_wa-REQ_QTY = Stru_Zsaleitem-REQ_QTY.
      item_wa-COND_TYPE   = Stru_Zsaleitem-COND_TYPE.
      item_wa-COND_VALUE = Stru_Zsaleitem-COND_VALUE.
      append item_wa to item_data.
    CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT1'
      EXPORTING
        ORDER_HEADER_IN           = header_data
      WITHOUT_COMMIT            = ' '
      CONVERT_PARVW_AUART       = ' '
    IMPORTING
       SALESDOCUMENT             = sales_order
      SOLD_TO_PARTY             =
      SHIP_TO_PARTY             =
      BILLING_PARTY             =
       RETURN                    = errorlog
      TABLES
        ORDER_ITEMS_IN            = item_data
        ORDER_PARTNERS            = partner_data
      ORDER_ITEMS_OUT           =
      ORDER_CFGS_REF            =
      ORDER_CFGS_INST           =
      ORDER_CFGS_PART_OF        =
      ORDER_CFGS_VALUE          =
      ORDER_CCARD               =
      ORDER_CFGS_BLOB           =
      ORDER_SCHEDULE_EX         =
    endmethod.
    PLEASE SUGGEST ME IF ANY CODE CHANGE IS REQUIRED
    Thanks in advance
    Ajay

    Hi,
    The item data is not read because, the dynamically added rows should also reflect back to the Web Dynpro context. When the user clicks on Add Row, use the Onsubmit event to add a empty line to internal table and then bind it to the context. And if the user removes a row, remove a row from internal table and bind it back to the context.
    You may refer this article.
    http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/802f0ed1-a17a-2c10-7db4-d515a5b047ed
    Regards,
    Runal

  • Line item data does not appear on all master pages - Adobe forms

    Hi Guys,
    I have a problem in Adobe forms as explained below-
    I have a page in the form which has, you can say, a 2 windows or subforms (  Information window/subfirm on top right corner, main on middle of the page ). The data of the main subform is a line item data of delivery. Some parts of the same data need to be printed on the Information subform also. The main subform can overflow  to next pages but the information window will have only very limited data to be printed on one page itself, meaning it does not overflow.
    Now the requirement is that  each line item should be printed on a new page. For example if there are 2 lines items then first line item should be printed on first page. Then there will be a conditional page break and the next line item will be printed on the next page ( I have achieved this using condition page break). The information window will contain information related to corresponding line items. If the first line item data overflows in main then information window of first line item should be printed on first and 2nd page. The second line item should start printing on 3rd page and information window of  3rd page will contain data of 2nd line item.
    I created 1 body page and 1 master page. I created one internal table with data of main window and information window. I put the information window on master page to make it appear on all the pages. 
    This solution unfortunately does not work. The issue is that in case of overflow, 1st page information window shows first line item. 2nd pages shows 2nd line item and 3rd page is blank whereas ideally 1st and 2nd page information window should show first line item and 3rd page should show 2nd line item. This means that master page and body page are not getting linked. If I create the information window on body page itself, it does not repeat on all the pages. Please provide some inputs to resolve the issue.
    Thanks
    Abhi

    Hi Abhinav,
        I am also trying to solve the similar issue. Need to print the internal table data in the Master page.
      Have you resolved this issue. Can you Please share your solution .
    Thanks
    Swarna.

  • Line item text is automatically disappeared

    Hello Experts,
    I have weird situation when I enter FI document.
    In FB01 transaction, I am going to enter the first line item data after I put the document header data.
    After I enter a G/L account, some values and line item text, I need to some data at 'More data' tab so that I click 'More data' button.
    When I go back to the screen for the first line item data after putting some data at 'More data' tab, the line item text that I have already entered before is automatically disappeared.
    Is there anyone who know why this happen?
    Thanks.
    BR,
    Chris

    Hello Raman,
    This is so weird.
    When we enter the document under language option 'EN', there is no problem like above.
    But in case we logon with our language 'KO', that problem happens.
    I think this might have something to do with language issue.
    Thanks.
    BR,
    Chris

  • Printing in only last line item printing in main window

    Hi All,
    My requiremnet is to print same data in two blocks for F110 payment cheque
    Iam using 2 main windows to print same data if block exceeds it will go to next page
    iam calling the windows as shown below
    CALL FUNCTION 'WRITE_FORM'
          EXPORTING
            window   = 'MAIN00'
            element  = hlp_ep_element
            function = 'APPEND'
          EXCEPTIONS
            window   = 1
            element  = 2.
        IF sy-subrc EQ 2.
          err_element-fname = t042e-zforn.
          err_element-fenst = 'MAIN00'.
          err_element-elemt = hlp_ep_element.
          err_element-text  = text_525.
          COLLECT err_element.
        ENDIF.
        CALL FUNCTION 'WRITE_FORM'
          EXPORTING
            window   = 'MAIN01'
            element  = hlp_ep_element
            function = 'APPEND'
          EXCEPTIONS
            window   = 1
            element  = 2.
        IF sy-subrc EQ 2.
          err_element-fname = t042e-zforn.
          err_element-fenst = 'MAIN01'.
          err_element-elemt = hlp_ep_element.
          err_element-text  = text_525.
          COLLECT err_element.
        ENDIF.
    Iam getting only last line item printing in main window
    Please provide the inputs.
    Thanks,
    Kamalakar.
    Please use code tags.
    Edited by: Rob Burbank on Nov 25, 2011 11:51 AM

    Hi,
    My requirement was to print same block twice in cheque printing of F110.
    I have used the function module  'WRITE_FORM_LINES' to print more than one line item in secondary window in the script .
    fill the Lines internal table as shown below.
    Example :
        lines-tdformat = 'TM'.
        CONCATENATE regup-xblnr ',,' w_date ',,'  w_bsak-sgtxt ',,' w_gross ',,' w_dis ',,'
        w_net INTO lines-tdline.
    APPEND lines.
    CALL FUNCTION 'WRITE_FORM_LINES'
          EXPORTING
           function                       = 'APPEND'
           header                         =  header_t
           type                           = 'BODY'
           window                         = 'MAIN01'
        IMPORTING
          FROMPAGE                       =
          PENDING_LINES                  =
          TABLES
            lines                          = lines
         EXCEPTIONS
           function                       = 1
           type                           = 2
           unopened                       = 3
           unstarted                      = 4
           window                         = 5
           bad_pageformat_for_print       = 6
           spool_error                    = 7
           codepage                       = 8
           OTHERS                         = 9
        IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
      ENDIF.

  • Validation for first line item ( table )

    Dear Friends,
    i have table with multiple line items, i want to validate first line item only, if first line item is initial, it should throw an error message, could any one pls help me with an example
    Thanks
    Vijaya
    Col1
    Col2
    Col3

    Hi Vijaya,
    Method get_static_attributes_table of interface if_wd_context_node will return a table of context elements. You can then either read the first row of that table or loop through it to validate the table's data and issue messages as needed. For example...
    data lo_nd_ctx_node type ref to if_wd_context_node.
    data lt_attributes_table type wd_this->elements_ctx_node.
    lo_nd_ctx_node = wd_context->get_child_node( name = wd_this->wdctx_ctx_node ).
    lo_nd_ctx_node->get_static_attributes_table( importing table = lt_attributes_table ).
    If the row to be validated happens to be the table's lead selection, you can fetch attributes of the lead selection row directly, and again validate and issue messages as needed...
    data lo_nd_ctx_node type ref to if_wd_context_node.
    data lo_el_ctx_element type ref to if_wd_context_element.
    data ls_attributes type wd_this->element_ctx_node.
    lo_nd_ctx_node = wd_context->get_child_node( name = wd_this->wdctx_ctx_node ).
    lo_el_ctx_element = lo_nd_ctx_node->get_element( ).
    lo_el_ctx_element->get_static_attributes( importing static_attributes = ls_attributes ).
    Both of these code patterns to read context data are available through the Web Dynpro Code Wizard.
    Cheers,
    Amy

  • How to delete the Cost center line item data

    How to delete the cost center line item data of particular cost center and only one cost center is exisiting for that company code.
    Is there any way to delete the line items in that cost center.
    Can data archiving & deleting can help us..........
    does it have any effect over other cost center data....
    any input needed.........
    regards
    rajesh

    Hi,
    i found 2 reports for you:
    1) CO_TOTAL_WRI - Archiving CO Totals Records   
    2) RKCOITW1     - Archiving CO Line Items: Write Program        
    from 2) is a linlk to customize archiv-parameters
    -> start it with transaction se38 / sa38
    A.

  • FB05 - trans to be processed and first line item PK for doc type

    Hi all,
    Me quite confused of the entry for the following document type in FB05
    DG - cust credit memo
    DR - cust invoice
    SA- gl acc doc
    SB - gl acc posting
    KG - vdr credit memo
    DZ - customer payment
    Need the help to let me know for document type above, what radio button to choose in transaction to be processed and also what posting key use at first line item.
    Also if i choose the wrong transaction to be processed radio button, any impact?
    thanks
    rgds

    Document type is primarily used to distinguish different various types of transactions. Ultimately, there are only two effects in accouting - debit and credit. Thus, doc type helps distinguish btw various types of accounting entries. It also controls certain field status while document posting and also drives the number range for the accounting document.
    Posting keys determine whether a transaction will be a credit or a debit. They also have an influence over the field status of the document entry screen. Posting keys are broadly divided into those belonging to
    Customer                             - Acct type C
    Vendors                               - Acct type V
    GL                                       - Acct type G
    Fixed Assets                        - Acct type A and
    Material Mgmt. transactions   - Acct type M
    For each account type there are both debit and credit posting keys. You can clik on F4 on the posting key field and see the various entries. You will understand.
    Thus, which posting key to enter depends on the transaction you want to enter.
    Regards,

  • Multiple line item in billing but only one line item in accounting document

    Hi Everyone,
    I am having one scenario in which sales order has more than one line item. Only one billing document is create for all line items in Sales Order but billing document contains as many items as sales order has. In accounting document of billing i find only one customer line which has total amount of all line items in billing as debited. My requirement is Accounting document also should have as many line of customer-debit as in billing items i.e sales order. For example :
    (1) Sales order has 2 line items.
    (2) Billing document is only ONE and has 2 line items
    (3) currently accounting document has only ONE line of Customet - Debit ( Total amount of both items)
    My requirement is
    Accounting document should have 2 line item of customer - Debit
    Customer - Debit (amount of first line item)
    Customer - Debit (amount of Second line item)
    Sales - Credit
    How can it be done ?
    Regards,
    Manish

    Hi,
    This is the SAP expected behaviour
    As far as the values correspond to same account key and same GL account as per account determination, then ti will be posted as a single line item in FI document.
    If you want the customer specific items to be posted in two GL accounts , then you have to do the account determination that way.
    For example, you should have a condition table in FICO as follows.
    Sales org/ Account key / Customer
    For this condition table, the entries shoudl be as follows.
    5110/ERS/Customer A  GL ACCOUNT IS 5000100
    5110/ERS/Customer B GL ACCOUNT IS  5000200
    In this case, there will be 2 entries for the invoice instead of just one line entry.

  • What is table name in SAP R/3 for PM order line item data

    Hello,
    I am extracting data for PM module and Interested in PM order line item data. Table AUFK is for PM order header master data.
    Is there any other table for PM order line item master data?
    Thanks,
    Ishak

    Hi Ishak,
    The item table is AUFP.
    Thanks.

  • Last line item gets changed to first line item for cs01

    HI experts,
               I have writen a BDC for Tcode cs01.
    I am facing a problem in that.If sucppose there are 4 line items,
    the first three line itmes are getting uploaded correctly but the kast line item gets changed to first line item.
    below is part of my code.
    DELETE ADJACENT DUPLICATES FROM T_MAT COMPARING MATNR.
    SORT T_MAT BY MATNR. "HEADER DATA
    SORT T_BOM BY MATNR1. "ITEM DATA
    *CLEAR : COUNTER, ITEM_NO.
    LOOP AT T_MAT INTO W_MAT.
      REFRESH GT_BDCDATA.
      CLEAR   GW_BDCDATA.
    perform bdc_dynpro      using 'SAPLCSDI' '0100'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RC29N-STLAN'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'RC29N-MATNR' W_MAT-MATNR.
                                 'lejn44001'.
    perform bdc_field       using 'RC29N-WERKS' W_MAT-PLANT.
                                 '4600'.
    perform bdc_field       using 'RC29N-STLAN' W_MAT-BOM_USAGE.
                                 '1'.
    *perform bdc_field       using 'RC29N-DATUV'
                                 '22.06.2010'.
    perform bdc_dynpro      using 'SAPLCSDI' '0110'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'RC29K-BMENG'
                                  '1'.
    perform bdc_field       using 'RC29K-STLST'
                                  '1'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RC29K-EXSTL'.
    perform bdc_dynpro      using 'SAPLCSDI' '0111'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RC29K-LABOR'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    LOOP AT T_BOM INTO W_BOM WHERE MATNR1 = W_MAT-MATNR.
      cnt = cnt + 1.
      CONCATENATE  '0' CNT INTO VAR.
       ADD 1 TO COUNTER.
       ITEM_NO = 10 * COUNTER.
       OVERLAY ITEM_NO WITH '0000'.
       W_BOM-ITM_NO = ITEM_NO.
    perform bdc_dynpro      using 'SAPLCSDI' '0140'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RC29P-POSTP(03)'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    CONCATENATE 'RC29P-IDNRK(' var ')' INTO new_mark.
    PERFORM bdc_field USING new_mark W_BOM-BOM_COMP.
    clear new_mark.
    CONCATENATE 'RC29P-MENGE(' var ')' INTO new_mark.
    PERFORM bdc_field USING new_mark W_BOM-QTY.
    clear new_mark.
    CONCATENATE 'RC29P-POSTP(' VAR ')' INTO NEW_MARK.
    perform bdc_field USING new_mark W_BOM-ITM_CAT.
    clear new_mark.
    clear VAR.
      ENDLOOP.
    loop at T_BOM INTO W_BOM WHERE MATNR1 = W_MAT-MATNR.
    perform bdc_dynpro      using 'SAPLCSDI' '0130'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RC29P-POSNR'.
    perform bdc_field       using 'RC29P-POSNR' V_CNT.
                                 '0010'.
    perform bdc_field       using 'RC29P-IDNRK' W_BOM-BOM_COMP.
                                 'PURCHASECOST'.
    perform bdc_field       using 'RC29P-MENGE' W_BOM-QTY.
                                 '20'.
    perform bdc_field       using 'RC29P-MEINS'
                                  'M'.
    perform bdc_dynpro      using 'SAPLCSDI' '0131'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RC29P-POTX1'.
    perform bdc_field       using 'RC29P-SANKA'
                                  'X'.
    V_CNT = V_CNT + 10.
    ENDLOOP.
    CLEAR V_CNT.
      perform screen_data. " IS ALL ABOUT CALLING TRANSACTION......
      ENDLOOP.
    following is The input file format m providing.
    Material     Plant     BOM usage     Item No     Item Cat     BOM component     QUANTITY
    WRJN46106     4600     1     10     z     PURCHASECOST     10
    WRJN46106     4600     1     20     z     SOURCINGCOST     15
    WRJN46106     4600     1     30     z     INVRESERVE     12
    WRJN46106     4600     1     40     Z     INVRESERVE1     20
    in this the first 3 line items are coming correctly but the 4th one gets changed to
    first line item.
    e.g INVRESERVE1 changes to purchasecost.
    plz help.
    Thanks n regards,
    Ashmita singh.

    Hi Suneel,
    I hardly can't believe that. There must be an mistake by your own in the smartform itself. Would you please share some screens or better, the smartform-XML itself. You can pass out everything else and just share the table and a dataset to try this.
    I'm pretty sure that there is something wrong with the settings or even the loop itself. I never faced a problem like that or even heared about such things.
    I would love to have a look inside.
    Before you share it, create a new one with just the table inside and try it with the same data. Perhaps it is just of to much folders or something like that, so the generating comes in trouble.
    Regards
    Florian

  • FI Line Item Data

    Hi,
            I have report against FIAR line items data(0FIAR_O03).The purpose is to report at Customer level for aged trail balance amounts(only for charge back amounts).I have the report ready and restricted document type only with CB- charge back.But the problem is,on the R/3 side for some CB accounts,there is a reference amounts like Credit memos or Customer Payments(document type DZ and DG).How can get these refrences into my report when i restrict the report only with CB.So under charge back ammount,the user should be able to see the associated Credit memos and Customer Payments as in R/3.Thanks for the help.
    Ravi.

    Hi Revathi,
    Kindly find the answers below :
    1.How the table BWOM2_TIMEST will work for delta & what is the selection will happen at BKPF-CPUDT
    Basically, BWOM2_TIMEST will show you the Last Time stamp for both Init and Delta..
    Whenever you will do an Init load.....automatically an entry will take place in this table.....and you will see a "X" sign in the field "LAst TS"....
    Also for Delta...there may be N number of entries with Update mode D....but only for the latest delta you will see a "X" sign in the field "LAst TS"....
    With Financial Accounting line items that have been posted in the SAP R/3 system since the last data request, the extractors identify the following delta dataset using the time stamp in the document header (BKPF-CPUDT).
    2.How the tbale will wok BWOM_SETTINGS for delta
    With these settings your delta extraction uses CPU date of recording records in table in R/3 to define your security interval with at least 1 day
    This means that your data is loaded until the actual day - 1.
    You can check the SAP note : 485958
    Regards,
    Debjani..

Maybe you are looking for