Bdc for ip01, data upload in table control

I was working on a bdc for ip01 . there is a table control - whose 5 rows are visible and I need to fill data upto 6 row . 6th row get filled by scrolling . will scrolling get captured in recording . whether this is possible or not sir . If yes then how?
Sir please help me.
With regards,

Hi
Scrolling does not get recorded while recording. You can achieve it by having ok_code to p+ or p++.
Refer the following link for detailed description.
http://wiki.sdn.sap.com/wiki/display/ABAP/BatchInputFAQ#BatchInputFAQ-Howtoscrollatablecontrol%3F
Hope this helps you.
Regards
Vinodh

Similar Messages

  • Function module Vs BDC for master data upload

    Hi ,
    Please advice we should use the following function modules for master data upload or we should go for BDC.
    MP_RFC_SINGLE_CREATE
    MP_RFC_INACT_CHANGE
    MPLAN_CREATE
    MPLAN_CHANGE
    MPLAN_SET_DELETION_INDICATOR
    ASSET_MASTERRECORD_MAINTENANCE
    MPLAN_ITEM_CREATE
    MPLAN_ITEM_CHANGE
    GL_ACCT_MASTER_SAVE
    GL_ACCT_MASTER_SAVE
    GL_ACCT_MASTER_SAVE
    Actually, we have already used these function modules in our upload program, but we are not sure if these function modules will create any data inconsistency.
    Please let me know, if we should continue using the FMs, or there is any risk using the FMs and we should replace them by BDC.
    Thanks in advance.

    HI Vikram,
    Better to serch for the BAPI for uploading the master data.Becuase we have problems with BDC and FM's.
    If you use FM's it does n't contain all the fields which you want.IF you go for BDC this is not maintainable for future releaseas.IF you upgrade then screen may change.
    IF don' have any BAPI then better go for BDC.
    Thanks

  • BDC for XK02 getting problem in table control.....

    hello i want to migrate data for vendor from flat file to SAP.i want to update VAT date and VAT number. but i m not getting how to handle index of table control? coz when we scroll down index get changed......
    pls guide me......

    Hi,
      refer the theards for table control index.
    https://forums.sdn.sap.com/click.jspa?searchID=12815720&messageID=5466905
    https://forums.sdn.sap.com/click.jspa?searchID=12815720&messageID=4290992
    Regards
    Kiran Sure

  • How to create BDC for Deletion of Records in Table Control in BDC for PFCG

    I have transcation PFCG and have to go to roles of users there.We will upload the users who has to be deleted and it should delete it from the PFCG in one go .Howcan I create a program to delete from the table .If i delete directly from DB table it doesnt show in SAP log how or Who deleted it  and the client wants this log which is needed for accountability.
    Pls HELP.
    George

    Hi
    You can only indicate the user and all profiles of the user will be deleted.
    DATA: BEGIN OF T_DEL_USR OCCURS 0,
                     USERNAME LIKE  BAPIBNAME-BAPIBNAME,
          END   OF T_DEL_USR.
    DATA T_RESULT TYPE STANDARD TABLE OF BAPIRET2
    WITH HEADER LINE.
    After loading the users to be deleted:
    LOOP AT T_DEL_USR.
      CALL FUNCTION 'SUSR_BAPI_USER_PROFILES_DELETE'
        EXPORTING
           USERNAME = T_DEL_USR-USERNAME
        TABLES
            RETURN =  T_RESULT.
    ENDLOOP.
    I'm not sure but perhaps u have to use bapi for commit too: BAPI_TRANSACTION_COMMIT
    Max

  • Reading selected data in the table control

    Hi Friends,
    I have final data in my table control now the user wants to select only few records from the displayed data, for that I kept a check box for selection, But my question is I am unable to read the selected data.
    Actually user requirement is he has to update only the selected data from the displayed data in the table control.
    Can any one tell me how to read the selected records after displaying in the table control.
    Thanx in advance,
    Line

    Hi
    If your table control has a check box, your internal table should have a field for it. Its value will be X if the checkbox is setted else it'll be SPACE.
    So in the PAI u should read only the records where that flag is X:
    LOOP AT ITAB WHERE MARK = 'X'.
    ENDLOOP.
    Max

  • Selecting data in the table control

    Hi Friends,
    I have final data in my table control now the user wants to select only few records from the displayed data, for that I kept a check box for selection, But my question is I am unable to read the selected data.
    Actually user requirement is he has to update only the selected data from the displayed data in the table control.
    Can any one tell me how to read the selected records after displaying in the table control.
    Thanx in advance,
    Line

    Hello Line,
    As gopi has suggested do the following..
    for the table control properties u have an option called W/SelColumn.
    Give in some name (ROW_SEL)to that and also include a field CHK in the internal which is being passed to the table control.
    and in the PAI of the table control module wirte like this...
    Then in your code..
    PROCESS BEFORE OUTPUT.
    PBO FLOW LOGIC FOR TABLECONTROL 'TABCONTROL'
    MODULE TABCONTROL_CHANGE_TC_ATTR.
    MODULE TABCONTROL_CHANGE_COL_ATTR.
    LOOP AT lt_final
    INTO lw_final
    WITH CONTROL tabcontrol
    CURSOR tabcontrol-current_line.
    MODULE tabcontrol_get_lines.
    MODULE TABCONTROL_CHANGE_FIELD_ATTR
    ENDLOOP.
    MODULE status_0101.
    PROCESS AFTER INPUT.
    PAI FLOW LOGIC FOR TABLECONTROL 'TABCONTROL'
    LOOP AT lt_final.
    MODULE read_data.
    MODULE tabcontrol_user_command.
    ENDLOOP.
    MODULE TABCONTROL_CHANGE_TC_ATTR.
    MODULE TABCONTROL_CHANGE_COL_ATTR.
    MODULE user_command_0101.
    MODULE tabcontrol_user_command input.
    if lt_final-chek = 'X'.
    *put your logic here something like
    move corresponding lt_final to gt_final.
    *now you have selcted rows data in gt_final.
    endif.
    endmodule.
    Regards

  • How can we do the validation for non visible records in table control.

    Hi Experts,
      I have a table control which displays list of material details. I have a button to upload the material details from excel file to table control directly. I have to validate all the customers which are exist in the table. But my item (Material) table control displays only 5 rows i.e only 5 entries are visible in module pool screen. The validation is done for 5 records only in PAI event, but i need to do validation for rest of the records too (Which are not visible on items table), if validation fails then needs to display error message.
      How can we do the validation for non visible records in table control.
    Regards,
    Bujji

    Hi,
    try validating material before displaying it in table control...'
    Rgds/Abhhi

  • Error when creating a bdc for asset master upload

    I am getting a warning message (AA186), when changing the depreciation start date to capitalization date. It says,
    "Different Order Dep. start date in depreciation area 01. Check"
    This error is a problem in creating the BDC for asset master upload. We have only one depreciaton area 01 (book dep).
    Please help.

    This is normal message you get when you try to change depn start date. I think this should not be a problem for BDC posting. This message can always be bypassed.

  • Reg:Efficient solution for a data upload scenario

    Hi All,
            I have the following task.
             Required  data from a legacy system(generate  data only in the form of flat files)to SAP R3 as FB01 journals and the output file should be generated periodically(daily,weekly,fortnightly etc…)
    Solution Approaches:
    1)Write a BDC program to extract the data.
    2) Write a ABAP Progam to populate IDoc (if standard IDOc is available) or generate a Outbound proxy (If standard IDoc is not available) to push the data into SAP XI.
    Could anyone  tell me which would be the the best and efficient approach for this task and need your recommendations.
    Thanks in Advance.
    B.Lavanya
    Edited by: Lavanya Balanandham on Mar 31, 2008 2:23 PM

    Hi Lavanya,
    Required data from a legacy system(generate data only in the form of flat files)to SAP R3 as FB01 journals - use BDC for this thing because it will be better for large source files.
    the output file should be generated periodically(daily,weekly,fortnightly etc…)  - if this output file contains acknowledgment for the data uploaded by the above process, create a ABAP report for it and schedule it..........but if this output contains some other IDOC data which you need to send as a file to a third-party system, then go for SAP XI provided the IDOC data is not too large... but if the IDOC size is huge, then just create a ABAP report for outputting data to a file on application server and FTP the file to third-party system.
    Regards,
    Rajeev Gupta

  • How to modify and save the data in the table control

    how to modify and save the data in the table control

    hi priya,
    kindly go thru the code below.
    PROCESS BEFORE OUTPUT.
      MODULE status_9010.
      LOOP WITH CONTROL tab_control.
        MODULE move_data_to_table.
      ENDLOOP.
    PROCESS AFTER INPUT.
      MODULE user_cancel AT EXIT-COMMAND.
      LOOP WITH CONTROL tab_control.
        MODULE move_data_from_table.
      ENDLOOP.
    MODULE move_data_to_table OUTPUT.
    This is to move the data from the internal table to *the table control
    *zmpets_mode-modecode, zmpets_range-rangeid, *zmpets_servfacto-factor are field names of the table *control columns.
      READ TABLE int_factor INDEX tab_control-current_line.
      IF sy-subrc = 0.
        zmpets_mode-modecode = int_factor-modecode.
        zmpets_range-rangeid = int_factor-rangeid.
        zmpets_servfacto-factor = int_factor-factor.
      ENDIF.
    ENDMODULE.                 " move_data_to_table  OUTPUT
    **********************************************8888
    MODULE move_data_from_table INPUT.
    *To move the data from the table control to internal *table 'INT_FACTOR'.
      int_factor-chk = line.
      int_factor-modecode = zmpets_mode-modecode.
      int_factor-rangeid = zmpets_range-rangeid.
      int_factor-factor = zmpets_servfacto-factor.
       MODIFY int_factor INDEX tab_control-current_line.
        IF sy-subrc NE 0.
          APPEND int_factor.
          CLEAR int_factor.
        ENDIF.
    ENDMODULE.                 " move_data_from_table  INPUT
    if this helps , kindly award points.
    for any clarification just mail me.
    regards,
    Anversha.S
    [email protected]

  • How to validate the dates in the table control ?

    How to validate the dates in the table control ?
    Can I write like this ?
    LOOP AT it_tab .
    CHAIN.
    FIELD : it_tab-strtdat,it_tab-enddat.
    module date_validation.
    ENDCHAIN.
    ENDLOOP.
    Module Date_validation.
    ranges : vdat type sy-datum.
    vdat-sign = 'I'.
    VDAT-LOW = it_tab-STRTDAT.
    VDAT-HIGH = it_tab-ENDDAT.
    VDAT-OPTION = 'BT'.
    APPEND VDAT.
    WHAT CODE I have to write here to validate ?
    and If I write like this How can we know which is the current row being add ?
    It loops total internal table ..?
    Bye,
    Muttu.

    Hi,
    I think there is no need to put chain endchain.
    To do validation you have to write module in PAI which does required validations.
    Thanks
    DARSHAN PATEL

  • Is it possible to assign user-defined data elements to table control?

    Hi SDN,
    Is it possible to assign a user defined data element other than basic data types in table control column.

    Hi Suresh,
    In Screen layout,In element list tab,i am not able to give the user-defined data types other than basic data types?please tell me how to give other data types

  • LSMW used only for master data upload?

    Hi
    Can you please let me know if LSMW is used only for master data upload or we can also use it for transaction data ?

    Hi Christino.
    I have come across a standard SDN thread which deals with the uploading master data, refer it:
    [SDN Reference for uploading master data using LSMW|how can we upload master data by using LSMW;
    [SDN reference for which uploading is preferred (Master data or Transaction data)|Which one is better for uploading data LSMW or ECATT ?;
    Good Luck & Regards.
    HARSH

  • BDC : to select different rows in table control

    Hi,
    I have to fill many rows in table control and want to select different row one by one  in increasing order which rows are filled in BDC.
    Can anybody suggest me with coding...
    thanks
    naresh

    Hi ,
    I am attaching sample code for BDC transaction code is : FV11 , This code is also contains poage down concepts . By using this page down concept you can add number of item fields
    Program Name        : ZFV11_NEW
    Program Description : To Upload Condition Records-FV11
    Author              : Jagadish
    Start Date          : 11/06/2007
    REPORT zfv11
           NO STANDARD PAGE HEADING LINE-SIZE 255.
       DO NOT CHANGE - the generated data section - DO NOT CHANGE    ***
      If it is nessesary to change the data section use the rules:
      1.) Each definition of a field exists of two lines
      2.) The first line shows exactly the comment
          '* data element: ' followed with the data element
          which describes the field.
          If you don't have a data element use the
          comment without a data element name
      3.) The second line shows the fieldname of the
          structure, the fieldname must consist of
          a fieldname and optional the character '_' and
          three numbers and the field length in brackets
      4.) Each field must be type C.
    Generated data section with specific formatting - DO NOT CHANGE  ***
    TABLES : t100.
    DATA: BEGIN OF record OCCURS 0,
    data element: KSCHA
            kschl(004),               "Condition Type
    data element: SELKZ_LIST
          selkz(001),
    data element: WERKS_D
            werks(004),               "Plant
    data element: ELIFN
            lifnr(010),               "Vendor
    data element: MATNR
            matnr(018),               "Material No.
    data element: KBETR_KOND
            kbetr(016),               "Amount
    data element: KODATAB
            datab(010),               "Condition Validity Date from
    data element: KODATBI
            datbi(010),               "Condition Validity To
    data element: MWSKZ
            mwsk1(002),
          END OF record.
    DATA : BEGIN OF it_new OCCURS 0,                    " Internal Table for Header Data
           kschl(004),
           werks(004),
           lifnr(010),
           END OF it_new.
    DATA : BEGIN OF it_item OCCURS 0,                  " Internal table for Item Data
          werks(004),
          lifnr(010),
          matnr(018),
          kbetr(016),
          datab(010),
          datbi(010),
          mwsk1(002),
          END OF it_item.
    DATA : cnt(2) TYPE n,
           fld(25) TYPE c.
    TYPE-POOLS: truxs.
    DATA: it_raw TYPE truxs_t_text_data.
    DATA : n TYPE n.
    DATA:
         BEGIN OF t_data OCCURS 0,
               data TYPE string,
         END   OF t_data.
    DATA:BEGIN OF it_mess OCCURS 0,
      msgtyp(5),
       lms(200),
       msgv1(50),
        END OF it_mess.
    DATA : p_mode    TYPE c.
    DATA:it_msgtab TYPE STANDARD TABLE OF  bdcmsgcoll WITH HEADER LINE,
       it_msgtab1 TYPE STANDARD TABLE OF bdcmsgcoll WITH HEADER LINE.
    DATA :  l_mstring(150).
    DATA : BEGIN OF bdcdata OCCURS 0.
            INCLUDE STRUCTURE bdcdata.
    DATA: END OF bdcdata.
    PARAMETERS : p_file1 LIKE rlgrap-filename.
    INITIALIZATION.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file1.
      PERFORM file_selection.
      PERFORM data_upload.
      PERFORM table_control.
      LOOP AT it_new.
        REFRESH bdcdata.
        PERFORM bdc_dynpro      USING 'SAPMV13A' '0100'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'RV13A-KSCHL'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '/00'.
        PERFORM bdc_field       USING 'RV13A-KSCHL'
                                      it_new-kschl.
        PERFORM bdc_dynpro      USING 'SAPLV14A' '0100'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'RV130-SELKZ(01)'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '=WEIT'.
        PERFORM bdc_dynpro      USING 'SAPMV13A' '1363'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'KONP-KBETR(01)'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '/00'.
        PERFORM bdc_field       USING 'KOMG-WERKS'
                                      it_new-werks.
        PERFORM bdc_field       USING 'KOMG-LIFNR'
                                      it_new-lifnr.
    DATA: "X(5) TYPE N,
             N(5) TYPE N.
       N = 0.
       LOOP AT it_item.
         N = N + 1.
       ENDLOOP.
       "X = 1.
       CNT = 1.
       DO N TIMES.
         IF CNT > 19.
           perform bdc_field       using 'BDC_OKCODE' 'KOMG-MATNR(01)'.
           perform bdc_field       using 'BDC_OKCODE' '=P+'.
           PERFORM bdc_dynpro      USING 'SAPMV13A' '1363'.
           CNT = 1.
         ENDIF.
        cnt = 1.
        LOOP AT it_item WHERE werks EQ it_new-werks AND lifnr EQ it_new-lifnr . "FROM x TO x.
          CONCATENATE 'KOMG-MATNR(' cnt ')' INTO fld.
          PERFORM bdc_field USING fld it_item-matnr.
          CONCATENATE 'KONP-KBETR(' cnt')' INTO fld.
          PERFORM bdc_field USING fld it_item-kbetr.
          CONCATENATE 'RV13A-DATAB(' cnt ')' INTO fld.
          PERFORM bdc_field USING fld it_item-datab.
          CONCATENATE 'RV13A-DATBI(' cnt ')' INTO fld.
          PERFORM bdc_field USING fld it_item-datbi.
          CONCATENATE 'KONP-MWSK1(' cnt ')' INTO fld.
          PERFORM bdc_field USING fld it_item-mwsk1.
          cnt = cnt + 1.
          if cnt = 20.
            perform bdc_field       using 'BDC_OKCODE' 'KOMG-MATNR(19)'.
            perform bdc_field       using 'BDC_OKCODE' '=P+'.
            PERFORM bdc_dynpro      USING 'SAPMV13A' '1363'.
            CNT = 1.
           endif.
    CLEAR it_item.
        ENDLOOP.
       ENDDO.
        PERFORM bdc_dynpro      USING 'SAPMV13A' '1363'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'KONP-MWSK1(01)'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '=SICH'.
        CALL TRANSACTION 'FV11' USING bdcdata MODE 'A'
                                            UPDATE 'S'
                                           MESSAGES  INTO it_msgtab.
        CLEAR bdcdata[].
        PERFORM error.
      ENDLOOP.
           Start new screen   -Subroutine     for screen s                                      *
    FORM bdc_dynpro USING program dynpro.
      CLEAR bdcdata.
      bdcdata-program  = program.
      bdcdata-dynpro   = dynpro.
      bdcdata-dynbegin = 'X'.
      APPEND bdcdata.
    ENDFORM.                    "BDC_DYNPRO
           Insert field        -Subroutine   for field s                                         *
    FORM bdc_field USING fnam fval.
      CLEAR bdcdata.
      bdcdata-fnam = fnam.
      bdcdata-fval = fval.
      APPEND bdcdata.
    ENDFORM.                    "BDC_FIELD
    *&      Form  file_selection
    FORM file_selection .
      CALL FUNCTION 'F4_FILENAME'
        EXPORTING
          program_name  = syst-cprog
          dynpro_number = syst-dynnr
          field_name    = 'P_FILE1'
        IMPORTING
          file_name     = p_file1.
    ENDFORM.                    " file_selection
    *&      Form  data_upload
    FORM data_upload .
      CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
       EXPORTING
        I_FIELD_SEPERATOR        =
           i_line_header            =  'X'
           i_tab_raw_data           =  it_raw
           i_filename               =  p_file1
         TABLES
           i_tab_converted_data     = record
        EXCEPTIONS
           conversion_failed        = 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.                    " data_upload
    *&      Form  error
    FORM error .
      LOOP AT it_msgtab.
        IF it_msgtab-msgtyp = 'E'.
          SELECT SINGLE * FROM t100 WHERE sprsl = it_msgtab-msgspra
                                    AND   arbgb = it_msgtab-msgid
                                    AND   msgnr = it_msgtab-msgnr.
          IF sy-subrc = 0.
            l_mstring = t100-text.
            IF l_mstring CS '&1'.
              REPLACE '&1' WITH it_msgtab-msgv1 INTO l_mstring.
              REPLACE '&2' WITH it_msgtab-msgv2 INTO l_mstring.
              REPLACE '&3' WITH it_msgtab-msgv3 INTO l_mstring.
              REPLACE '&4' WITH it_msgtab-msgv4 INTO l_mstring.
            ELSE.
              REPLACE '&' WITH it_msgtab-msgv1 INTO l_mstring.
              REPLACE '&' WITH it_msgtab-msgv2 INTO l_mstring.
              REPLACE '&' WITH it_msgtab-msgv3 INTO l_mstring.
              REPLACE '&' WITH it_msgtab-msgv4 INTO l_mstring.
            ENDIF.
            CONDENSE l_mstring.
            it_mess-msgtyp = it_msgtab-msgtyp.
            it_mess-lms = l_mstring.
            it_mess-msgv1 = it_msgtab-msgv1.
            APPEND it_mess.
           WRITE: / it_msgtab-msgtyp, l_mstring(150).
          ELSE.
           WRITE: / it_msgtab.
            it_mess-msgtyp = it_msgtab-msgtyp.
            it_mess-lms = l_mstring.
            it_mess-msgv1 = it_msgtab-msgv1.
            APPEND it_mess.
          ENDIF.
        ENDIF.
      ENDLOOP.
    ENDFORM.                    " error
    *&      Form  table_Control
    FORM table_control .
    SORT record BY lifnr matnr.
      LOOP AT record.
        ON CHANGE OF record-lifnr.
          MOVE-CORRESPONDING record TO it_new.
          APPEND it_new.
        ENDON.
        MOVE-CORRESPONDING record TO it_item.
        APPEND it_item.
      ENDLOOP.
    ENDFORM.                    " table_Control
    Reward if useful
    Thanks
    Jagadeesh.G

  • Help for "insert data to variable tables"

    hi, guys.
    I want to make a tool to upload mass-data then insert the data to tables of SAP for integrative test.
    for example, to input the object tablename "AAAA" from screen, the program willl find the information of this table then input the data to the "AAAA" tables.
    But i have no idea how to define the internal table to suit various tables ( by define dynamic table? or any other ways) ,could you kindly give me some advice?
    thanks a lot in advance.
    Message was edited by:
            huijuan zhao

    hi zhao,
    welcome to sdn,
    for your requirement u can use bdc to upload file to internal table then u can update these internal table fileds to sap tables.
    or
    use <b>gui_upload</b> function module to upload data to internal table then u can use just <b>insert</b> keyword to update sap tables.
    see this sample code to update the database table <b>edpar</b>,
    report  zsd_edpar_update no standard page heading.
    *&Purpose:
    *&        program will be used to update EDAPR table on a daily basis.
    *&        This update will be based on Customer Sold To / Ship To partner
    *&        functions assignment. Ship To customer(s) will be linked to
    *&        the appropriate Sold To customer using the ?Acct at Cust?
    *&        number as a reference.  Then, Ship To customer(s) will be
    *&        set up withthe appropriate partner function with the Sold
    *&        To customer.it updated the DB tabel and gives the information
    *&        of customer level visibility t account receivable.
    *define database tables...
    tables: edpar,
            knvv,
            knvp.
    *define types...
    types: begin of t_tab_edpar,
           mandt type mandt,
           kunnr type kunnr,
           parvw type parvw,
           expnr type edi_expnr,
           inpnr type edi_inpnr.
    types: end of t_tab_edpar.
    types: begin of t_tab_knvv,
           kunnr type kunnr,
           vkorg type vkorg,
           vtweg type vtweg,
           spart type spart,
           eikto type eikto.
    types: end of t_tab_knvv.
    types: begin of t_tab_knvp,
           kunnr type kunnr,
           vkorg type vkorg,
           vtweg type vtweg,
           spart type spart,
           parvw type parvw,
           kunn2 type kunn2.
    types: end of t_tab_knvp.
    type-pools: slis.
    *define data statments...
    data: g_tab_edpar type standard table of t_tab_edpar,
          g_wa_edpar  like line of g_tab_edpar.
    data: g_tab_edpar1 type standard table of t_tab_edpar,
          g_wa_edpar1  like line of g_tab_edpar1.
    data: g_tab_edpar2 type standard table of t_tab_edpar,
          g_wa_edpar2  like line of g_tab_edpar2.
    data: g_tab_knvv type standard table of t_tab_knvv,
          g_wa_knvv  like line of g_tab_knvv.
    data: g_tab_knvp type standard table of t_tab_knvp,
          g_wa_knvp  like line of g_tab_knvp.
    data: repid like sy-repid,
          l_tab_fieldcat  type slis_t_fieldcat_alv,
          l_tab_fieldcat1 type slis_t_fieldcat_alv,
          l_tab_fieldcat2 type slis_t_fieldcat_alv,
          layout type slis_layout_alv,
          events  type slis_t_event,
          events1 type slis_t_event,
          wa_events  like line of events,
          l_pos type i.
    *selection screen...
    selection-screen begin of block b1 with frame title text-001.
    select-options: s_cust for knvv-kunnr obligatory,
                    s_sorg for knvv-vkorg,
                    s_dcha for knvv-vtweg,
                    s_divi for knvv-spart,
                    s_parf for knvp-parvw.
    selection-screen end of block b1.
    *start-of-selection...
    perform get_data.
    *to update the db table edpar...
    perform update_edpar.
    *display alv block...
    perform alv_block.
    *&      Form  get_data
          text
    -->  p1        text
    <--  p2        text
    form get_data .
      select kunnr
             vkorg
             vtweg
             spart
             parvw
             kunn2
             from knvp
             into table g_tab_knvp
             where
             kunnr in s_cust
             and
             vkorg in s_sorg
             and
             vtweg in s_dcha
             and
             spart in s_divi
             and
             parvw in s_parf.
      loop at g_tab_knvp into g_wa_knvp.
        move: g_wa_knvp-kunnr to g_wa_edpar-kunnr,
              g_wa_knvp-kunn2 to g_wa_edpar-inpnr,
              g_wa_knvp-parvw to g_wa_edpar-parvw.
        append g_wa_edpar to g_tab_edpar.
      endloop.
      if not g_tab_knvp[] is initial.
        select kunnr
               vkorg
               vtweg
               spart
               eikto
               from knvv
               into table g_tab_knvv
               for all entries in g_tab_knvp
               where
               kunnr eq g_tab_knvp-kunnr
               and
               vkorg eq g_tab_knvp-vkorg
               and
               vtweg eq g_tab_knvp-vtweg
               and
               spart eq g_tab_knvp-spart.
        loop at g_tab_knvp into g_wa_knvp .
          sort g_tab_knvv by kunnr.
          clear g_wa_knvv-eikto.
          read table g_tab_knvv into g_wa_knvv with key kunnr = g_wa_knvp-kunnr.
          if sy-subrc eq 0.
            move: g_wa_knvv-eikto to g_wa_edpar-expnr.
            modify g_tab_edpar from g_wa_edpar transporting expnr where kunnr eq g_wa_knvp-kunnr.
          endif.
        endloop.
      endif.
      sort g_tab_edpar by kunnr.
      delete adjacent duplicates from g_tab_edpar comparing kunnr parvw.
    endform.                    " get_data
    *&      Form  update_edpar
          text
    -->  p1        text
    <--  p2        text
    form update_edpar .
      delete from edpar." FROM TABLE g_tab_delete.
      call function 'DB_COMMIT'.
      loop at g_tab_edpar into g_wa_edpar.
        insert into edpar values g_wa_edpar.
        if sy-subrc  eq 0.
          move-corresponding g_wa_edpar to g_wa_edpar1.
          append g_wa_edpar1 to g_tab_edpar1.
        else.
          move-corresponding g_wa_edpar to g_wa_edpar2.
          append g_wa_edpar2 to g_tab_edpar2.
        endif.
      endloop.
    reward points if helpful,
    regards,
    seshu.

Maybe you are looking for

  • Hp3070a not wireless printing with windows 8

    Help! Going mad! My printer use to print wirelessly and then stopped. I reset once by looking on google but now don;t know what to do. I have Surface tablet with windows 8 (i think!). Prints with USB fine. Thank you so much. Ruth

  • FM PROB

    HI.. Iam new in using ALV... this is the following report i created... When iam executing the following report its getting short dumped.. can anyone help me out in this... I didnt know how to use the FM reuse_alv_fieldcatalog_merge and iam facing pro

  • Nokia 6233 - screen awakes from Power Save / Sleep...

    I have Power Save and Sleep Mode on, but ScreenSaver off. However, the screen often awakes from PowerSave / Sleep (not sure which - manual doesn't describe the difference) and lights up. This is especially annoying when driving and the Nokia is on a

  • Mixing geospatial queries with business rules

    Is there an easy way to incorporate a Spatial-/Locator-based geo-spatial query into an Oracle Business Rules rule? For example (pardon my psuedo-code): IF pub within 2 miles of my house AND pub sells cider THEN walk to pub If not then is there anothe

  • Installing Windows 7 on the Yoga

    My office had me pick out a laptop for work so I picked the Yoga.  Unfortunately due to licenses, they had to install Windows 7 (of which I was unaware).  Now I can't connect to WiFi because there is no network driver.  I googled the issue but can't