Add new line in ALV report on click of button...

Dear All,
How to add a new line for input in ALV report at runtime, on click of a button.
Waiting for early and favorable reply.
Regards,
Dharmesh Vyas

Hi,
First of all u have to Create ur own PF-status and Assign Fcode e.g 'INSERTROW'.
So, whenevr you will click Insertrow button it will be triggered in your User Command and then just Append the blank line in your Final Internal Table.
And Refresh Icon will be there by default...
To Trigger it You have to write rs_selfield-refresh = 'X'
You can also follow the below link...
Try it.
Link:[http://wiki.sdn.sap.com/wiki/display/ABAP/ALVeasytutorial].
Regards
Arbind

Similar Messages

  • Add new line in ALV report and Refresh button

    How to add a new line in a ALV report?
    How to add a refresh button in a report?

    Hi,
    First of all u have to Create ur own PF-status and Assign Fcode e.g 'INSERTROW'.
    So, whenevr you will click Insertrow button it will be triggered in your User Command and then just Append the blank line in your Final Internal Table.
    And Refresh Icon will be there by default...
    To Trigger it You have to write rs_selfield-refresh = 'X'
    You can also follow the below link...
    Try it.
    Link:[http://wiki.sdn.sap.com/wiki/display/ABAP/ALVeasytutorial].
    Regards
    Arbind

  • Add New Column in ALV Report of Standard SAP ME28.

    Hi anybody,
    I want add new column in alv report of standard SAP Program ME28 Screen.
    Add Last PO Price column inside ALV Report ME28 Screen.
    Can u please anybody tell me how to add new column in ME28 Screen.
    Thanks
    S.Muthu.

    Try to find any BADI for the same
    Follow the below steps to find out what all BADI's are called when you press any button in any transaction.
    1) Goto se24 (Display class cl_exithandler)
    2) Double click on the method GET_INSTANCE.
    3) Put a break point at Line no.25 (CASE sy-subrc).
    Now
    4) Execute SAP standard transaction
    5) Press the required button for which you need to write an exit logic, the execution will stop at the break point.
    6) Check the values of variable 'exit_name', it will give you the BADI name called at that time.
    7) This way you will find all the BADIs called on click of any button in any transaction.
    OR
    Also one more option is to copy ME28 and, make modifications to the copied program.

  • Unwanted field validation when adding new line to ALV (ABAP OO)

    Hi,
    We are using OO Controls to create an editable ALV grid, whose structure contains debit/credit indicator.
    When we click on the standard add new line button, a new line is added but an error message appears telling the user to enter a valid credit/ debit indicator (of course it is blank in the new line).
    This is annoying for users - is there any way to suppress this when....but just when a new line is being created?
    Thanks,
    Tristan

    Debug and find out what is the sy-ucomm when you add a new line in the ALV. And then In the validation of "enter a valid credit/ debit indicator " put a IF condition to check the if the SY-ucomm is not for inseting new line.
    Hope this helps.
    Fran

  • ADD A line in alv with values

    Hi Experts,
    When clicking the button 'append row', I want to add a line filled with some values in selection screen.
    I work with OO.
    need help please.
    Mohamed

    Hello Mohamed
    The logic is the same as before. Search for $MODFIED to detect the changes in the sample report.
    However, I do not think that these requirements make any sense because if you re-implement the Copy function you obviously have to re-implement the Paste function (and perhaps Undo function as well), too.
    So basically you reinvent the wheel again.
    *& Report  ZUS_SDN_ALV_GRID_EDITABLE
    *& Thread: ADD A line in alv with values
    *& <a class="jive_macro jive_macro_thread" href="" __jive_macro_name="thread" modifiedtitle="true" __default_attr="974654"></a>
    REPORT  zus_sdn_alv_grid_editable_1x.
    TYPE-POOLS: abap.
    DATA:
      gd_okcode        TYPE ui_func,
      gd_repid         TYPE syst-repid,
      gif_adapter      TYPE REF TO if_salv_adapter,
      go_docking       TYPE REF TO cl_gui_docking_container,
      go_grid1         TYPE REF TO cl_gui_alv_grid,
      gt_fcat          TYPE lvc_t_fcat,
      gs_layout        TYPE lvc_s_layo.
    DATA:
      gt_outtab        TYPE STANDARD TABLE OF knb1.
    *       CLASS lcl_eventhandler DEFINITION
    CLASS lcl_eventhandler DEFINITION.
      PUBLIC SECTION.
        CLASS-DATA:
          md_function    TYPE ui_func   READ-ONLY,
          ms_row         TYPE lvc_s_row READ-ONLY,
          ms_outtab      LIKE LINE OF gt_outtab.  "$MODIFIED
        CLASS-METHODS:
          handle_double_click FOR EVENT double_click OF cl_gui_alv_grid
            IMPORTING
              e_row
              e_column
              es_row_no
              sender,
           handle_toolbar FOR EVENT toolbar OF cl_gui_alv_grid
             IMPORTING
               e_object
               sender,
           handle_user_command FOR EVENT user_command OF cl_gui_alv_grid
             IMPORTING
               e_ucomm
               sender,
           handle_data_changed FOR EVENT data_changed OF cl_gui_alv_grid
             IMPORTING
              er_data_changed
              e_onf4
              e_onf4_before
              e_onf4_after
              e_ucomm
              sender.
    ENDCLASS.                    "lcl_eventhandler DEFINITION
    *       CLASS lcl_eventhandler IMPLEMENTATION
    CLASS lcl_eventhandler IMPLEMENTATION.
      METHOD handle_double_click.
      ENDMETHOD.                    "handle_double_click
      METHOD handle_toolbar.
        " define local data
        DATA: ls_button   TYPE stb_button.
        " Redefine toolbar button functions in order to be able to
        " handle them in event USER_COMMAND (standard toolbar functions
        " do NOT raise event USER_COMMAND !!!)
        LOOP AT e_object->mt_toolbar INTO ls_button.
          CASE ls_button-function.
            WHEN cl_gui_alv_grid=>mc_fc_loc_append_row.
              ls_button-function = 'APPEND_ROW'.
            WHEN cl_gui_alv_grid=>mc_fc_loc_insert_row.
              ls_button-function = 'INSERT_ROW'.
            WHEN cl_gui_alv_grid=>mc_fc_loc_copy.  "$MODIFIED
              ls_button-function = 'COPY'.
            WHEN OTHERS.
              CONTINUE.
          ENDCASE.
          MODIFY e_object->mt_toolbar FROM ls_button INDEX syst-tabix.
        ENDLOOP.
      ENDMETHOD.                    "handle_toolbar
      METHOD handle_user_command.
        " Get current row for function 'Insert Row'
        CALL METHOD sender->get_current_cell
          IMPORTING
    *        e_row     =
    *        e_value   =
    *        e_col     =
            es_row_id = ms_row
    *        es_col_id =
    *        es_row_no =
        " Store redefined function code
        md_function = e_ucomm.
        CASE e_ucomm.
          WHEN 'APPEND_ROW'  OR
               'INSERT_ROW'.
            " Just trigger PAI
            CALL METHOD cl_gui_cfw=>set_new_ok_code
              EXPORTING
                new_code = 'NEW_ROW'
    *          IMPORTING
    *            rc       =
          WHEN 'COPY'.  "$MODIFIED
            READ TABLE gt_outtab INTO ms_outtab INDEX ms_row-index.
          WHEN OTHERS.
        ENDCASE.
      ENDMETHOD.                    "handle_user_command
      METHOD handle_data_changed.
    *   define local data
        DATA: ls_outtab        LIKE LINE OF gt_outtab,
              ls_good          TYPE lvc_s_modi.
        BREAK-POINT.
        LOOP AT er_data_changed->mt_good_cells INTO ls_good
                WHERE ( fieldname = 'ERDAT' ).
    **      CALL METHOD er_data_changed->get_cell_value
    **        EXPORTING
    **          i_row_id    = ls_good-row_id
    **          i_fieldname = ls_good-fieldname
    **        IMPORTING
    **          e_value     = ls_outtab-erdat.
          ls_outtab-erdat = ls_good-value.
          IF ( ls_outtab-erdat < '20070101' ).
            CALL METHOD er_data_changed->add_protocol_entry
              EXPORTING
                i_msgid     = '00'
                i_msgty     = 'E'
                i_msgno     = '398'
                i_msgv1     = 'Date must be >= 01.01.2007'
    *          i_msgv2     =
    *          i_msgv3     =
    *          i_msgv4     =
                i_fieldname = ls_good-fieldname
                i_row_id    = ls_good-row_id
                i_tabix     = ls_good-tabix.
          ENDIF.
        ENDLOOP.
        er_data_changed->display_protocol( ).
        " Not really required (only for validations)
      ENDMETHOD.                    "handle_data_changed
    ENDCLASS.                    "lcl_eventhandler IMPLEMENTATION
    START-OF-SELECTION.
      SELECT * FROM  knb1 INTO TABLE gt_outtab UP TO 10 ROWS.
      PERFORM init_controls.
    * Link the docking container to the target dynpro
      gd_repid = syst-repid.
      CALL METHOD go_docking->link
        EXPORTING
          repid                       = gd_repid
          dynnr                       = '0100'
    *      CONTAINER                   =
        EXCEPTIONS
          OTHERS                      = 4.
      IF sy-subrc NE 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    * NOTE: dynpro does not contain any elements
      CALL SCREEN '0100'.
    * Flow logic of dynpro (does not contain any dynpro elements):
    *PROCESS BEFORE OUTPUT.
    *  MODULE STATUS_0100.
    *PROCESS AFTER INPUT.
    *  MODULE USER_COMMAND_0100.
    END-OF-SELECTION.
    *&      Module  STATUS_0100  OUTPUT
    *       text
    MODULE status_0100 OUTPUT.
      SET PF-STATUS 'STATUS_0100'.  " contains push button "DETAIL"
    *  SET TITLEBAR 'xxx'.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    *&      Module  USER_COMMAND_0100  INPUT
    *       text
    MODULE user_command_0100 INPUT.
      CASE gd_okcode.
        WHEN 'BACK'  OR
             'EXIT'  OR
             'CANC'.
          SET SCREEN 0. LEAVE SCREEN.
        WHEN 'NEW_ROW'.
          PERFORM add_new_row.
        WHEN OTHERS.
      ENDCASE.
      CLEAR: gd_okcode.
    ENDMODULE.                 " USER_COMMAND_0100  INPUT
    *&      Form  ADD_NEW_ROW
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM add_new_row .
    * define local data
      DATA: ls_outtab   LIKE LINE OF gt_outtab,
            ls_stable   TYPE lvc_s_stbl,
            ld_idx      TYPE i.
      ls_outtab-bukrs = '1000'.
      ls_outtab-ernam = syst-uname.
      CASE lcl_eventhandler=>md_function.
        WHEN 'APPEND_ROW'.
          APPEND ls_outtab TO gt_outtab.
        WHEN 'INSERT_ROW'.
          ld_idx = lcl_eventhandler=>ms_row-index + 1.
          INSERT ls_outtab INTO gt_outtab INDEX ld_idx.
        WHEN OTHERS.
      ENDCASE.
      " Refresh ALV list display
      ls_stable-row = abap_true.
      ls_stable-col = abap_true.
      CALL METHOD go_grid1->refresh_table_display
         EXPORTING
           is_stable      = ls_stable
    *      i_soft_refresh =
         EXCEPTIONS
           finished       = 1
           OTHERS         = 2.
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    " ADD_NEW_ROW
    *&      Form  INIT_CONTROLS
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM init_controls .
    * Create docking container
      CREATE OBJECT go_docking
        EXPORTING
          parent = cl_gui_container=>screen0
          ratio  = 90
        EXCEPTIONS
          OTHERS = 6.
      IF sy-subrc NE 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    * Create ALV grids
      CREATE OBJECT go_grid1
        EXPORTING
          i_parent = go_docking  " go_cell_top
        EXCEPTIONS
          OTHERS   = 5.
      IF sy-subrc NE 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      " ENTER trigger event DATA_CHANGED
      CALL METHOD go_grid1->register_edit_event
        EXPORTING
          i_event_id = cl_gui_alv_grid=>mc_evt_enter
        EXCEPTIONS
          error      = 1
          OTHERS     = 2.
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    * Set event handler
      SET HANDLER:
        lcl_eventhandler=>handle_double_click FOR go_grid1,
        lcl_eventhandler=>handle_toolbar      FOR go_grid1,
        lcl_eventhandler=>handle_user_command FOR go_grid1,
        lcl_eventhandler=>handle_data_changed FOR go_grid1.
      PERFORM build_fieldcatalog.
    * Display data
      gs_layout-grid_title = 'Customers'.
      gs_layout-smalltitle = abap_true.
      CALL METHOD go_grid1->set_table_for_first_display
        EXPORTING
    **      i_structure_name = 'KNB1'
          is_layout        = gs_layout
          ir_salv_adapter  = gif_adapter
        CHANGING
          it_outtab        = gt_outtab
          it_fieldcatalog  = gt_fcat
        EXCEPTIONS
          OTHERS           = 4.
      IF sy-subrc NE 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    " INIT_CONTROLS
    *&      Form  BUILD_FIELDCATALOG
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM build_fieldcatalog .
    * define local data
      DATA: ls_fcat   TYPE lvc_s_fcat.
      CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
        EXPORTING
          i_structure_name       = 'KNB1'
        CHANGING
          ct_fieldcat            = gt_fcat
        EXCEPTIONS
          inconsistent_interface = 1
          program_error          = 2
          OTHERS                 = 3.
      ls_fcat-edit = abap_true.
      MODIFY gt_fcat FROM ls_fcat
        TRANSPORTING edit
        WHERE ( key NE abap_true ).
    ENDFORM.                    " BUILD_FIELDCATALOG
    Regards
      Uwe

  • How to insert horizontal lines in alv report?

    hi,
        i have to insert horizontal lines in alv report.( RM07MLBB )
            actually my requirement is:
                               basis list = RM07MLBB.
    first secondary list = another report is called here ( RM07DOCS )
                      i want to insert horizontal lines in the first secondary list, when i execute individually RM07DOCS , i can get horizontal lines, but when i dounle click in the basic list --> in the first secondary list , i am not getting the horizontal lnes.
    functional modules used are REUSE_ALV_HIERSEQ_LIST_DISPLAY & REUSE_ALV_GRID_DISPLAY.
        here in this program,
                        is_layout = alv_layout.
    hence i tried to give     
                  alv_layout-no_hline = ' '. 
    but not effecting.
              can some one please tell me , how to insert lines in the alv report.
    thanks in advance,
    Dastagir.

    hello,
         so i cannot insert horizontal lines in the first secondary list according to my sorting condition, i.e., in a single block there should be :
           if same delivery challan number is repeating they should come in the same block,
    for the corresponding delivery challen number, if have po number, is repeating , they also should come in the same block.
                       in this way i have to seperate the blocks containing EXNUM , EBELN CONDITIONED.

  • Add new line items in ISA B2B

    Hi All,
    My requirement is to add new line items automatically onto the shopping basket based on a main configurable line item addition.
    Unfortunately this could not be configured for a variety of reasons.
    This has to done after the user clicks on Accept on the config pop-up for this Part and before he returns to the shopping basket.(I believe the CRM_ISA_BASKET_CHANGE would be called at this point)
    ISA would pass to the backend the extension values for the new Material to be added and the Main item(config item number) in the function call.
    So technically what would be best approach to add new line items and tie it to a parent line item if ISA can send both the values(new Material/Parent Product) in extension table to the backend?
    Did someone face this situation before. If yes can you please let me know which methods in the backend were used?
    Thanks a lot.

    Hi,
    May I know how did you resolve this problem.
    Thanks in advance.
    amar.s

  • How to add new lines

    hai Friends , i've some problems, i really don't know how to add new line when typing
    Thanks

    Sorry you feel that way. It is still a new platform and is improving with every update. Hopefully the next update will make things better for you then.
    If you want to thank someone for their comment, do so by clicking the Thumbs Up icon.
    If your issue is resolved, don't forget to click the Solution button on the resolution!

  • Please help to add new line at Header layout FBL3N

    Dear Expert,
    I need a requirement to custom the program from tcode FBL3N. So i copied the program become my custom program.
    At the custom program, I need to add a new line for display total balance GL account for the previous month at header layout, under text company code.
    For the Information, FBL3N used ALV List to display layout.
    Is it possible to add new line??
    If it's possible, how is the way to add that new line to display the total GL account?
    I really appreciate your suggestion and solution.
    Thank you,

    Thanks for all your help. My problem was that I was using 2 lists to update the table. The problem solve!!!!
    int modelIndex = listWhenScrollStop.size () - 1 - aRow;
    if (modelIndex >= 0) {
    return listWhenScrollStop.get (listWhenScrollStop.size () - 1 - aRow);

  • How to add new line in transact move order line

    Hi,
    i am able to update locaotr in Transact move order.
    But i want to add two locators for the same line.
    I tried to insert one more record in data base, but getting error unique index error.
    so how can we add new line in transact move order line .
    please help to slove this isse.
    Thanks In Advance
    Venu.

    Hi,
    the fact that your question is posted in Order Management section, does the move order automatically generated by OM?
    nevertheless, i don't think you should (or allowed, in this case) to add a new line in transact move order. Transact move order only queries (not create records) the move order lines eligible to allocate and transact.
    So, I don't see why you need to add a new line in transact move order.
    You can, however, add a new line in the allocation of the lines, where for instance, you need to have half of the line allocated to one locator, and the other half to another locator
    Thanks

  • How to add new line in message on my S890

    My stock keyboard in Lenovo S890 doesn't have enter key, is this normal ? How to add new line ?
    However this happened only in messages, while using whatsapp the enter key present.

    Hi,
    the fact that your question is posted in Order Management section, does the move order automatically generated by OM?
    nevertheless, i don't think you should (or allowed, in this case) to add a new line in transact move order. Transact move order only queries (not create records) the move order lines eligible to allocate and transact.
    So, I don't see why you need to add a new line in transact move order.
    You can, however, add a new line in the allocation of the lines, where for instance, you need to have half of the line allocated to one locator, and the other half to another locator
    Thanks

  • BAPI_SALESORDER_CHANGE add new line and conditions with a condition value

    Hi,
    I am using BAPI_SALESORDER_CHANGE to add new lines to a credit memo. All works fine except that I can not seem to put a condition value on the new lines. The condition is created but with a value of 0. I can popluate the condition amount field, KBETR but not KWERT. BAPICONDX seems to only have the COND_VALUE field in it and not CONDVALUE as in BAPICOND. Does anyone have any idea how to do this? In the code below I just want to change the material on the first line of the credit memo and not add the condition. Then add new lines with the the condition.
    lw_order_header_inx-updateflag  = 'U'.
      LOOP AT i_accru INTO wa_accru.
        lv_count = lv_count + 1.
        lv_posnr = lv_count * 10.
    * Order Items
        lw_order_item_inx-itm_number = lv_posnr.
        lw_order_item_inx-material   = 'X'.
        IF lv_count = 1.
          lw_order_item_inx-updateflag    = 'U'.
        ELSE.
          lw_order_item_inx-updateflag    = 'I'.
        ENDIF.
        APPEND lw_order_item_inx TO lt_order_item_inx.
        lw_order_item_in-itm_number = lv_posnr.
        lw_order_item_in-material   = wa_accru-vakey.
        APPEND lw_order_item_in TO lt_order_item_in.
    * Conditions
        IF lv_count <> 1.
          lw_conditions_inx-itm_number = lv_posnr.
          lw_conditions_inx-cond_st_no = '905'.
          lw_conditions_inx-cond_count = '01'.
          lw_conditions_inx-cond_type  = 'ZHIE'.
          lw_conditions_inx-currency   = 'X'.
          lw_conditions_inx-updateflag = 'I'.
          APPEND lw_conditions_inx TO lt_conditions_inx.
          lw_conditions_in-itm_number = lv_posnr.
          lw_conditions_in-cond_st_no = '905' .
          lw_conditions_in-cond_count = '01'.
          lw_conditions_in-cond_type  = 'ZHIE'.
          lw_conditions_in-condvalue  = wa_accru-accru.
          lw_conditions_in-currency   = 'GBP'.
          APPEND lw_conditions_in TO lt_conditions_in.
        ENDIF.
      ENDLOOP.
    * Change the credit memo
      CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
        EXPORTING
          salesdocument               = lv_vbeln
          order_header_in             = lw_order_header_in
          order_header_inx            = lw_order_header_inx
    *   SIMULATION                  =
    *   BEHAVE_WHEN_ERROR           = ' '
    *   INT_NUMBER_ASSIGNMENT       = ' '
    *   LOGIC_SWITCH                =
    *   NO_STATUS_BUF_INIT          = ' '
        TABLES
          return                      = lt_return
          order_item_in               = lt_order_item_in
          order_item_inx              = lt_order_item_inx
    *   PARTNERS                    =
    *   PARTNERCHANGES              =
    *   PARTNERADDRESSES            =
    *   ORDER_CFGS_REF              =
    *   ORDER_CFGS_INST             =
    *   ORDER_CFGS_PART_OF          =
    *   ORDER_CFGS_VALUE            =
    *   ORDER_CFGS_BLOB             =
    *   ORDER_CFGS_VK               =
    *   ORDER_CFGS_REFINST          =
    *   SCHEDULE_LINES              =
    *   SCHEDULE_LINESX             =
    *   ORDER_TEXT                  =
    *   ORDER_KEYS                  =
         conditions_in               = lt_conditions_in
         conditions_inx              = lt_conditions_inx
    *   EXTENSIONIN                 =
      IF sy-subrc = 0.
        CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    * EXPORTING
    *   WAIT          =
    * IMPORTING
    *   RETURN        =
      ENDIF.

    Hi Rob,
    Have you managed to solve this issue. If so, could you please share the solution.
    I am also facing similar problem.
    Thanks for your help.
    Anoop

  • Add new line item in VA02 by copying same Order line details

    Hi All,
    I've a requirement where i need to add new line items in the Sales Order (T Code VA02) with reference to the same Order lines . For e.g an Order 80000100 which has 2 line items and the requirement is to create a new line i.e. line item 0030 by copying the details from the existing line item 0010 of the same order .
    I've checked the BAPI - BAPI_SALESDOCUMENT_COPY which is for Order Creation T Code VA01 . I'm looking out for Sales Order Change BAPI where i can give the reference as Order no and Order line item which will create a new line item in the same Order with the same details of the reference Order line item .
    Do let me know your thoughts !!!!
    Thanks,
    Bintu

    Hi -
    Please check these two FM's BAPI_SALESORDER_GETDETAILBOS & BAPI_SALESORDER_CHANGE.
    Regards,
    Atul Mohanty

  • How to add new line item using BAPI BAPI_CONTRACT_CHANGE for contract-ME32K

    HI Experts,
    how to add new line item using BAPI: BAPI_CONTRACT_CHANGE for existing contract.
    Requirement:
    Already the contract having two line items using ME31K.
    Custom program has to add new line items in existing contract.
    Thanks,
    Sendil

    I got the solution:
    We can do like this:
    1. Get all details using details, BAPI_CONTRACT_GETDETAIL.
    2. After getting results, append new line item. Then use your BAPI.
    Check this posting program.. where this bapi is used, use the same coding technique.
    IDOC_INPUT_PURCONTRACT_CHANGE

  • Add new line in the Flat file based on the field value

    Hi,
    Following is my Flat File -
    Customer   X      Y
    1001          1       2
    1002          0       1
    Based on the X and Y value I need to add new lines in the Flat file. If X>0 then add a new line with repeating row and Y>0 add again a new line with repeating row. If X or Y=0 then no need to add any repeating new line. 
    So, here for the above example I need output as-
    Customer    X    Y
    1001          1      2
    1001         1       2
    1001         1       2
    1002          0       1
    1002          0        1
    Suggest how we can achieve this?
    Regards,
    Tridib Konwar 

    Hi Tridib,
        I tried your scenario and You will have to use the custom xslt to get the expected result.
        Please find bellow the xslt code which you can use in your map.
    <?xml version="1.0" encoding="utf-16" ?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:var="http://schemas.microsoft.com/BizTalk/2003/var" exclude-result-prefixes="msxsl var" version="1.0" xmlns:ns0="http://PracticeAtul.XYFlatFileSchema">
    <xsl:output omit-xml-declaration="yes" method="xml" version="1.0" />
    <xsl:template match="/">
    <xsl:apply-templates select="/ns0:XYComp" />
    </xsl:template>
    <xsl:template match="/ns0:XYComp">
    <ns0:XYComp>
    <XYComp_Child1>
    <XYComp_Child1_Child1>
    <xsl:value-of select="XYComp_Child1/XYComp_Child1_Child1/text()" />
    </XYComp_Child1_Child1>
    <XYComp_Child1_Child2>
    <xsl:value-of select="XYComp_Child1/XYComp_Child1_Child2/text()" />
    </XYComp_Child1_Child2>
    <XYComp_Child1_Child3>
    <xsl:value-of select="XYComp_Child1/XYComp_Child1_Child3/text()" />
    </XYComp_Child1_Child3>
    <xsl:value-of select="XYComp_Child1/text()" />
    </XYComp_Child1>
    <xsl:for-each select="XYComp_Child2">
    <XYComp_Child2>
    <XYComp_Child2_Child1>
    <xsl:value-of select="XYComp_Child2_Child1/text()" />
    </XYComp_Child2_Child1>
    <XYComp_Child2_Child2>
    <xsl:value-of select="XYComp_Child2_Child2/text()" />
    </XYComp_Child2_Child2>
    <XYComp_Child2_Child3>
    <xsl:value-of select="XYComp_Child2_Child3/text()" />
    </XYComp_Child2_Child3>
    </XYComp_Child2>
    <xsl:if test="XYComp_Child2_Child2/text()!=0">
    <XYComp_Child2>
    <XYComp_Child2_Child1>
    <xsl:value-of select="XYComp_Child2_Child1/text()" />
    </XYComp_Child2_Child1>
    <XYComp_Child2_Child2>
    <xsl:value-of select="XYComp_Child2_Child2/text()" />
    </XYComp_Child2_Child2>
    <XYComp_Child2_Child3>
    <xsl:value-of select="XYComp_Child2_Child3/text()" />
    </XYComp_Child2_Child3>
    </XYComp_Child2>
    </xsl:if>
    <xsl:if test="XYComp_Child2_Child3/text()!=0">
    <XYComp_Child2>
    <XYComp_Child2_Child1>
    <xsl:value-of select="XYComp_Child2_Child1/text()" />
    </XYComp_Child2_Child1>
    <XYComp_Child2_Child2>
    <xsl:value-of select="XYComp_Child2_Child2/text()" />
    </XYComp_Child2_Child2>
    <XYComp_Child2_Child3>
    <xsl:value-of select="XYComp_Child2_Child3/text()" />
    </XYComp_Child2_Child3>
    </XYComp_Child2>
    </xsl:if>
    </xsl:for-each>
    </ns0:XYComp>
    </xsl:template>
    </xsl:stylesheet>
    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful.
    Atul Toke

Maybe you are looking for

  • Album Cover won't display properly

    I just purchased a TV Season of a show, and every episode downloaded properly, but the Album Art cover does not display correctly. I really hope I don't have to delete, and purchase this season again. Has this happened to anyone else? How is there a

  • 4002 error in itunes since 10.7 update

    Does anyone know how widespread the problem is or what timeframe apple has for fixing it?

  • TS1372 when connecting my ipod nano to itunes, it states unknown error (2005) ? Thank you

    When I connect my ipod nano to itunes it shows an error, unknown (2005) and it my ipod doesn't appear. I have a shuffle and it recognises that fine. Has my nano given up or is there something I can do? Thank you for any help

  • I had to reinstall iTunes, do I have to get the iTunes match again?

    I recently had to reinstall Tunes because it was not starting up. I wanted to download songs from the iCloud onto my iPhone but my recent purchases were not there. DO I have have to start the syncing with the iCloud all over again?

  • No decimals in ALV presentation

    Hello everyone, I have an ALV that shows 40 columns with quantities. The ALV is referenced to a specific structure created in SE11 that has all 40 fiels of type MENGE1. The quantities shown are allways going to be integers, so i don't need the 3 deci