Need help in ABAP coding in start routine

Hi,
I have a requriement like
-To take the value of month which is an attribute of category(info Object) for which category value is 1. I need to apply the month obtained as the filter to another info object. I have opted to write this ABAP code in start routine. Can anyone guide me on this code.
Thanks in advance.

do you not have an abap-er at your disposal? i don't imagine this to be quick & dirty that can be written without access to your system! some analysis work may also be required before the actual coding can be done...so I wouldn't post the entire functional spec (business requirement) here hoping for a solution; that would be too weird.
Regards.

Similar Messages

  • Error in abap coding in start routine..

    Hello Gurus,
    I am having difficulty run this program, can anyone advise?
    IF wa_datapackage-calday LT l_rundate.
    SELECT SINGLE /BIC/AUMR05005
    INTO l_latestvisitdate
    FROM /BIC/PAUMRSO0200
    WHERE fiscper = wa_datapackage-fiscper AND "fiscper
    /BIC/AUMR01310 = wa_datapackage-/BIC/AUMR01300 AND "customer
    /BIC/AUMR02001 = wa_datapackage-/BIC/AUMR02001 AND "product
    /BIC/AUMR03204 = wa_datapackage-/BIC/AUMR03204 AND "questions
    /BIC/AUMR03202 = wa_datapackage-/BIC/AUMR03202. "subject
    IF sy-subrc = 0.
    IF wa_datapackage-calday > l_latestvisitdate.
    APPEND wa_datapackage TO lt_datapackage.
    ENDIF.
    ENDIF.
    ELSE.
    APPEND wa_datapackage TO lt_datapackage.
    ENDIF.
    The above program gies the following error:
    E:"/BIC/PAUMRSO0200" is not defined in the ABAP Dictionary as a table, projection view or database view.
    Can you suggest any probable solution?
    Thanks & Regards,
    JP

    Hi JP,
    Check in SE11, /BIC/AUMR05005 may be defined as a structure, not as a table or view.
    You may need to use some other table or view.
    Reward points if useful.
    Regards,
    Atish

  • Need help with ABAP coding using java

    Dear experts,
    I have used ABAP to code many reports/function modules.However as i know java quite well,i want to achieve the same using java.I have utilized JCO to retrieve information from RFC in this mission.
    However i realized that i had to code all things using ABAP and use java only as interface to connect to
    SAP fetch that module and display information on console.It was not that fun.
    I want that i should not Login to SAP but work only using java.
    I heard SAP Netweaver is a good choice.But i dont know much about it.Will i be able to develop reports only by java and how ?
    Plz suggest.

    hi,
    I hope that you already have the J2ME Toolkit and that your emulator works okay. In the toolkit you get several examples to show you how to program a MIDlet. One has to do with a HTTP client server connection. Also in the API documentation for the J2ME there is a Connector class that you used to set up this communication and in the description of this class it pretty thoroughly explains how to set up an HTTP protocol client.
    However, if you want to do some other kind of networking then you are pretty much out of luck, as the TCPIP socket protocol has not been fully implemented and is optional to the J2ME specifications, only the HTTP protocol is certain to be available. This means that mobile phone companies can add other networking functionality to their phone's java virtual machine if they feel like it. This is a bummer I know.
    I hope this helps.
    Cheers,
    Mark

  • Need help in ABAP coding

    Hi Gurus,
    here i hav some complication for displaying data in output.In output I have to show characteristics(ysd-characteristics,,,, ysd is a customized tablehaving fields vbeln, matnr, posnr, characteristics......) of material with respect to sales document number(vbap-vbeln).when I am executing the prog with below SELECT statement----
    select distinct
                        ysd~vbeln
                         ysdposnr  ysdmatnr
                ysd~characteristic
                        vbapposnr  vbapmatnr
                         vbap~arktx
                        vbap~kwmeng
                         into corresponding fields of table itab1
               from ysd_famd_chrctcs as ysd inner join vbap
              on ysdvbeln = vbapvbeln
              and ysdposnr = vbapposnr
               where vbap~vbeln = p_vbeln.
    After looping itab1 it is giving output like below.  
    -->>
    Sr |   MatNum | MatDesc | Charecteristics | Quantity
    no |                |               |                        |
    1   | 00000012 |   CCslab |   Moisture         |   50
    1   | 00000012 |   CCslab |   over size         |   50
    1   | 00000012 |   CCslab |   under size       |   50
    1   | 00000012 |   CCslab |   phos percnt     |   50
    1   | 00000012 |   CCslab |   chrome           |   50
    1   | 00000012 |   CCslab |   Ferrous           |   50
    but output should be like below
    -->>
    Sr |   MatNum | MatDesc | Charecteristics | Quantity
    no |                |               |                        |
    1   | 00000012 |   CCslab |   Moisture         |   50
                                         |   over size         |  
                                         |   under size       |  
                                         |   phos percnt     |  
                                         |   chrome           |  
                                         |   Ferrous           |  
    what should i write with select statement to get this.
    I tried using DELETE ADJACENT...... but it is deletin all characteristics from output.
    pls help...
    Regard
    Saif

    Hi,
    You can make use of AT NEW .... ENDAT statements.
    Declare another internal table ITAB2 & its corresponding work area.
    Refer the below code:
    Loop at ITAB1 INTO WA_ITAB1.
    CLEAR F_FLAG.
    AT NEW MATNR.
    WA_ITAB2-MATNR = WA_ITAB1-MATNR.
    WA_ITAB2-DESC   = WA_ITAB1-DESC.
    similarly do the same for other fields...
    f_flag = 1.
    ENDAT.
    IF f_flag NE '1'.
    WA_ITAB2-MATNR = SPACE.
    WA_ITAB2-DESC   = SPACE.
    WA_ITAB2-CHAR   = WA_ITAB1-CHAR.
    ENDIF.
    APPEND WA_ITAB2 TO ITAB2.
    CLEAR WA_ITAB2.
    ENDLOOP.
    Just try and see.
    reward points if useful.
    Thanks,
    Asha

  • Convert ABAP code in start routine/update rule to transform. start routine

    Dear BW ABAPers,
    I have created a custom purchasing info cube (YCP_PURC1) based on 0CP_PURC1 standard cube. I would like to convert this new data flow to BI7 (from 3.x), and convert the standard update rule to transformation. I would need to rewrite the below start routine from the standard update rule to a start routine ABAP code in the newly created  transformation / start routine. My ABAP knowledge is limited. Will you please help?
    *this is the start routine from the update rule. As a side note, the data source is 2LIS_02_SCL.
    LOOP AT SOURCE_PACKAGE.
        IF (     SOURCE_PACKAGE-cppvlc  EQ 0
             AND SOURCE_PACKAGE-cppvoc  EQ 0
             AND SOURCE_PACKAGE-cpquaou EQ 0 ).
          DELETE SOURCE_PACKAGE.
          CONTINUE.
        ENDIF.
    no_scl is initial ( e.g. for good receipts, billing)
    value has to be set depending on storno
        IF SOURCE_PACKAGE-no_scl IS INITIAL.
          IF SOURCE_PACKAGE-storno = 'X'.
            SOURCE_PACKAGE-no_scl = -1.
          ELSE.
            SOURCE_PACKAGE-no_scl = 1.
          ENDIF.
          MODIFY SOURCE_PACKAGE.
        ENDIF.
      ENDLOOP.
    if abort is not equal zero, the update process will be canceled
      ABORT = 0.
    Many thanks and look forward to your kind feedback.
    Kind regards,
    Csaba

    Dear All, Durgesh,
    thanks to you all for your valuable input. Mainly the ABAP part was more interesting for me.
    Durgesh, thanks for your input, it was useful. I just had to change the info objects to data source fields and add the lines before the loop:
    DATA: I_PACKAGE TYPE TYT_SC_1.
        FIELD-SYMBOLS <i_package> TYPE tys_sc_1.
        I_PACKAGE[] = SOURCE_PACKAGE[].
        LOOP AT SOURCE_PACKAGE assigning <i_package>.
          IF ( <i_package>-BWGEO EQ 0
          AND <i_package>-BWGEOO EQ 0
          AND <i_package>-BWMNG EQ 0 ).
            DELETE SOURCE_PACKAGE index sy-tabix.
            CONTINUE.
          ENDIF.
    no_scl is initial ( e.g. for good receipts, billing)
    value has to be set depending on storno
          IF <i_package>-NOSCL IS INITIAL.
            IF <i_package>-ROCANCEL = 'X'.
              <i_package>-NOSCL = -1.
            ELSE.
              <i_package>-NOSCL = 1.
            ENDIF.
          ENDIF.
        ENDLOOP.
    Points have been assigned accordingly.
    Thanks,
    Csaba

  • ABAP Code in Start Routine for restricing the data records from ODS1 - ODS2

    Hi
    I need small ABAP Code in Start Routine Of Update rules Of ODS . Im in BW 3.5 .
    I have records like below in first layer ODS and i want to restrict some records while going to second layer ODS ..
    ODS1 :-
    DocNO   EventType    Date
    123         001             08/08/2008
    123         003             08/08/2008
    123         011              09/08/2008
    I want one record in ODS2 for this document number whose EventType = 001 only and date of third record ... like below
    Doc NO     EventType      From Date          Todate
    123              001               08/08/2008         09/08/2008
    So how can i get like this record in the ODS2 which will get data from ODS1 . So i need to write the code in the start routine of the ODS2 .
    So please give the me the code for start routine ....
    Regards
    Suresh

    Its difficult in BW 3.5 to include this logic in START_ROUTINE as you cannot add the extra to_date field to the DATA_PACKAGE table.
    You need to create a new global internal table with the same structure of DATA_PACKAGE with additional field to_date. then use the logic to fill in the global internal table
    define a internal table new_data_package with the required structure like (docno, eventtype, fromdate todate)
    data: l_w_datapkg_001 type data_package,
    data: l_w_newdatapkg type new_data_package,
    data: l_w_datapkg_011 type data_package
    LOOP AT DATA_PACKAGE INTO l_w_datapkg_001 WHERE event_type = '001'.
    l_w_newdatapkg-docno = l_w_datapkg_001-docno.
    l_w_newdatapkg-event_type = l_w_datapkg_001-event_type.
    l_w_newdatapkg-fromdate = l_w_datapkg_001-date.
    MOVE CORRESPONDING FIELDS OF l_w_datapkg_001 INTO l_w_newdatapkg.
    READ TABLE data_package INTO l_w_datapkg_011
    WITH KEY docno = l_w_datapkg_001-docno
                     event_type = '011'.
    l_w_newdatapkg-to_date = l_w_datapkg_011-date.
    APPEND l_w_newdatapkg TO new_data_package          
    ENDLOOP.
    Now the new datapackage contains the ODS2 data that u needed

  • Hi, I need help my computer is not starting up at all, nothing happening when I press the button on/off. The battery charger is working as using it for another laptop. Not sure what to do. Anyone have any idea? many thanks

    Hi, I need help my computer is not starting up at all, nothing happening when I press the button on/off. The battery charger is working as using it for another laptop. Not sure what to do. Anyone have any idea? many thanks

    You could try a SMC reset:
    http://support.apple.com/kb/HT3964
    If no change, do what Allan advises.
    Caio.

  • Execute ABAP code in Start Routine only once

    I have ABAP code in a start routine that I only want to execute once. Is there a way to tell this is first execution of the start routine?
    Also can I find out these value in the start routine ABAP:
    1. How many data packets there are?
    2. What data packet I am processing?
    Regards,
    Mike...

    Hi,
    I've just setup a little test:
    TRules, Start Routine Global Decl:
    DATA: GVI TYPE I, GVN(5) TYPE N.
    Start Routine:
    IF GVI IS INITIAL.
    GVI = 1.
    ELSE.
    ADD 1 TO GVI.
    ENDIF.
    MOVE GVI TO GVN.
    This is basically counting the times the start routine is executed and populating the var GVN; I am posting GVN in a char ZTESTGV in the target cube. I am posting as well the datapakID in my cube.
    I have loaded two requests (each 4 packets)
    the first one first to PSA and then from the PSA to the target: this is Serially using one single process. Here's the result in the cube:
    Request________________________________DATAPAKID_____ZTESTGV
    REQU_8B5ASGQNYYNIV1OJN68HFH1SR____________1____________1
    REQU_8B5ASGQNYYNIV1OJN68HFH1SR____________2____________2
    REQU_8B5ASGQNYYNIV1OJN68HFH1SR____________3____________3
    REQU_8B5ASGQNYYNIV1OJN68HFH1SR____________4____________4
    In this case the global variable is persistent accross packets.
    the second request is loaded in paralell: this is, multiple processes are executed at the time. Here's the result in the cube:
    Request________________________________DATAPAKID_____ZTESTGV
    REQU_14QVH21BSVH44FAJW94BD7N2H____________1____________1
    REQU_14QVH21BSVH44FAJW94BD7N2H____________2____________1
    REQU_14QVH21BSVH44FAJW94BD7N2H____________3____________1
    REQU_14QVH21BSVH44FAJW94BD7N2H____________4____________1
    In this case the global variable is always1 !!
    This is logic since several a process cannot access the internal memory used by another one...
    Conclusion; the global variable will work only if the load is serial...
    hope this helps...
    Olivier.

  • ABAP Code in Start Routine to fill a field

    Hello,
    with the following code in the start routine in BW3.5 I am trying to fill Intercompany-Indicator based on Distribution Channel. The main code is marked bold.
    Distribution Channel = DISTR_CHAN
    InterCompany-Indicator = G_CWWR14
    Pls help. Thanks.
    SD
    Intercompany Indicator
        IF NOT wa_daten-customer IS INITIAL.
          SELECT SINGLE /b05/s_rbkunde FROM  /b05/mrbcust INTO l_rbcust
                 WHERE  /b05/s_rbcust  = wa_daten-customer
                 AND    objvers        = 'A'
                 AND    datefrom      <= l_date
                 AND    dateto        >= l_date.
          IF sy-subrc EQ 0.
            SELECT SINGLE g_cwwr14 FROM  /b05/mrbkdbkrs INTO l_ii
                   WHERE  comp_code        = wa_daten-comp_code
                   AND    /b05/s_rbkdbkrs  = l_rbcust
                   AND    objvers          = 'A'
                   AND    datefrom        <= l_date
                   AND    dateto          >= l_date.
            IF sy-subrc = 0.
              wa_daten-g_cwwr14 = l_ii.
            ELSE.
              CLEAR wa_daten-g_cwwr14.
            ENDIF.
          ELSE.
            CLEAR wa_daten-g_cwwr14.
          ENDIF.
        ELSE.
          IF wa_daten-G_CWWR14 = ' '.
            CASE wa_daten-DISTR_CHAN.
              WHEN 'Y4'.
                wa_daten-G_CWWR14 = '4'.
              WHEN 'Y5'.
                wa_daten-G_CWWR14 = '2'.
              WHEN OTHERS.
                wa_daten-G_CWWR14 = '0'.
            ENDCASE.
          ENDIF.
        ENDIF.      " NOT wa_daten-customer IS INITIAL
        MODIFY DATA_PACKAGE FROM wa_daten.
      ENDLOOP.

    Hi Venkat,
      Two things -One is the performance and the other ... there is no Append  within the loop.
      Try moving the select statement ousdie the loop to improve performance and move the modify statement into the loop ... change modify to append. Code below.
       Let me know if you need more help.
    Best regards,
    Kazmi
    data: it_data type standard table of data_package_structure
    with header line
    with non-unique default key initial size 0.
    types: begin of billing_item_type,
    BILL_NUM like /BIC/AZSD_O0700-BILL_NUM,
    DOC_NUMBER like /BIC/AZSD_O0700-DOC_NUMBER,
    PLANT like /BIC/AZSD_O0700-PLANT,
    end of billing_item_type.
    refresh it_data.
    clear it_data.
    it_data] = DATA_PACKAGE[.
    refresh DATA_PACKAGE.
    clear DATA_PACKAGE.
    loop at it_data.
    select DOC_NUMBER PLANT into (it_data-DOC_NUMBER, it_data-PLANT)
    from /BIC/AZSD_O0700
    where BILL_NUM = it_data-BILL_NUM
    and FISCVARNT = it_data-fiscvarnt.
    endselect.
    if sy-subrc = 0.
    move-corresponding it_data to DATA_PACKAGE.
    Append DATA_PACKAGE.
    endif.
    endloop.

  • ABAP code in start routine (delete no in)

    In my start routine, I would like to delete some data package whose employee id is not in the selection list.
    but there are some ABAP grammer error in the where condition. Can somebody help this? I tried to read the document for 'WHERE - IN seltab', but still I could not give the right code.
    <p>
      employeeid_itab type table of string.
      select /bic/zpe_employeeid into table employeeid_itab from /bic/pzpe_employeeid.
      DELETE SOURCE_PACKAGE where ZEMP_employee_ID NOT IN employeeid_itab.
    It seems that internal table employeeid_itab could not be directly used after the IN keyword.
    how can I do this?
    Edited by: Ben Li on Feb 22, 2008 2:09 PM

    Hi Oscar,
          Actually I had tried this before, using the code like the following,
          <p>
    Types: EmployeeID(7) type  c.
    <p>
    data: sel_itab type  range of EmployeeID.
    <p>
    select /bic/zpe_employeeid into table sel_itab from /bic/pzpe_employeeid.
    <p>
    delete SOURCE_PACKAGE where zemp_employee_id  not in sel_itab.
    <p>
         The grammer check is OK, but when I debug it, I found that there are records in sel_itab, but all the records just have one charactor, actually, my employeeID have 7 charactors in database. So it does not work, I think I miss something in define  of the range table. Can you please figure out? Thanks a lot.

  • Need help in ABAP.

    HI gurus,
    I AM KISHORE i am SD consultant.here my client is asking to create some programmes. i need help in simple programmes so that as per that i can change the fiels as per my requirement.
          i am in real big problem now .i know these are very simple programmes but i don't know ABC of programming.
    can some one help me in this regard.  this ABAP help is needed for me only for some time.
    the requirement:  
    create program which will produce list with:
       Materia number; Material description ; Valuation class, Standard price with curency and unit.
    Select conditions:
       Material number,
       Plant,
       Material type                                as mandatory
       Material Group                              as mandatory,
       LP/KD/MIP  (LABOR)                    as mandatory,
       Replenishment strategy (TEMPB)   as mandatory,
       Valuation class,
       Flag for deletion-Client Level  with initial value <> ‘X’  (only materials without flag for deletion)
    Simple List is enough
    reagrds
    kishore

    Hi
    Eventhough i cant fullfill your complete requirement. I'm giving u a report performed by me in which most of the fields are covered ask any of abaper to make modifications in this report and change it to accordingly ur requirement. I think it will solve 80% of ur work
    * tables
    TABLES: ekko,ekbe,ekpo,ekkn,konh,konv,esll,ekbz,rseg,lfa1,j_1ipart1,
    j_1igrxref.
    TYPE-POOLS: slis.
    *data definituon
    DATA:
          wa_ekko LIKE ekko,
          wa_ekbe LIKE ekbe,
          wa_ekkn LIKE ekkn,
          wa_konp LIKE konp,
          wa_ekpo LIKE ekpo,
          wa_rbkp LIKE rbkp,
          wa_j_1ipart1 LIKE j_1ipart1,
          wa_j_1igrxref LIKE j_1igrxref,
          wa_rseg LIKE rseg OCCURS 0 WITH HEADER LINE.
    DATA: ws_vakey LIKE konh-vakey,
          ws_kbetr LIKE konp-kbetr,
          ws_kbetr1 LIKE konp-kbetr,
          ws_kbetr2 LIKE konp-kbetr,
          ws_ecs LIKE j_1igrxref-ecs,
          ws_ebelp LIKE ekbz-ebelp,
          ws_ebeln LIKE ekko-ebeln,
          ws_belnr LIKE ekbe-belnr,
          ws_beznk LIKE  rbkp-beznk,
          ws_wrbtr_f LIKE ekbz-wrbtr,
          ws_rmwwr LIKE rbkp-rmwwr,
          ws_rbkp_benz.
    *internal tables
    DATA: BEGIN OF int_outtab OCCURS 0,
          lifnr      LIKE ekko-lifnr,               " vend no
          name1      LIKE lfa1-name1,               " vend name
          werks      LIKE ekpo-werks,               "  plant
          ebeln      LIKE ekko-ebeln,               " po no
          knumv      LIKE ekko-knumv,
          ebelp      LIKE ekbe-ebelp,
          matnr      LIKE ekpo-matnr,               " mat no
          txz01      LIKE ekpo-txz01,               " mat desceiption
          kostl      LIKE ekkn-kostl,               " cost center
          ps_psp_pnr LIKE ekkn-ps_psp_pnr,          " WBS element
          netwr      LIKE ekpo-netwr,
          " basic value           (po)
          kbetr      LIKE konp-kbetr,
          " excise value          (po)
          kwert_i    LIKE konv-kwert,
          " insurance value       (po)
          kwert_f    LIKE konv-kwert,
          " frieght value         (po)
          kwert_t    LIKE konv-kwert,
          " vat/tax value         (po)
          kwert_o    LIKE konv-kwert,
          " others                (po)
          kwert_total LIKE konv-kwert,
          " total                 (po)
          ecs        LIKE j_1igrxref-ecs,
          " excise                (ap)
          wmwst1     LIKE   rbkp-wmwst1,
          " tax amount            (ap)
          wrbtr_f       TYPE ekbz-wrbtr,
          " freight               (ap)
          wrbtr       TYPE ekbz-wrbtr,
          beznk      LIKE    rbkp-beznk,
          " Unplanned cost        (ap)
          refwr_g    TYPE  ekbe-refwr,
          " gross                 (ap)
          rmwwr   LIKE  rbkp-rmwwr,
          "  Actual Invoice Total (ap)
          buzei      LIKE ekbz-buzei,               "item for material doc
          gjahr      LIKE ekbe-gjahr,
          tax        LIKE ekbe-wrbtr,                " tax (ap)
          actual_total LIKE ekbe-wrbtr,
    *      belnr      LIKE rseg-belnr,
           belnr     LIKE ekbe-belnr,
          vakey      LIKE konh-vakey,
          cpudt      LIKE ekbe-cpudt,
          budat      LIKE ekbz-budat,
          belnr_ekbz LIKE ekbz-belnr,              "to get excise value
    *      aedat     LIKE ekpo-aedat,
          bedat   LIKE ekko-bedat,
          waers     LIKE lfm1-waers,               " currency
          END OF int_outtab.
    DATA:   int_konv LIKE konv OCCURS 0 WITH HEADER LINE,
    *        int_ekbe LIKE ekbe OCCURS 0 WITH HEADER LINE,
            int_ekbz LIKE ekbz OCCURS 0 WITH HEADER LINE.
    DATA: BEGIN OF int_konh OCCURS 0,
          knumh LIKE konh-knumh,
          kschl LIKE konh-kschl,
          vakey LIKE konh-vakey,
          END OF int_konh.
    DATA: BEGIN OF int_konp OCCURS 0,
          knumh LIKE konp-knumh,
          kschl LIKE konp-kschl,
          kbetr LIKE konp-kbetr,
          END OF int_konp.
    DATA: BEGIN OF int_ekkn OCCURS 0,
          ebeln      LIKE ekkn-ebeln,
          ebelp      LIKE ekkn-ebelp,
          kostl      LIKE ekkn-kostl,
          ps_psp_pnr LIKE ekkn-ps_psp_pnr,
          END OF int_ekkn.
    DATA: BEGIN OF int_outtab1 OCCURS 0,
          exbed      LIKE j_1igrxref-exbed,
          ecs        LIKE j_1igrxref-ecs,
          END OF int_outtab1.
    DATA: BEGIN OF int_ekbe OCCURS 0,
          ebelp LIKE ekbe-ebelp,
          refwr LIKE ekbe-refwr,
          wrbtr LIKE ekbe-wrbtr,
          shkzg LIKE ekbe-shkzg,
          END OF int_ekbe.
    DATA: BEGIN OF int_total OCCURS 0,
          ebeln LIKE ekko-ebeln,
          ebelp LIKE ekbe-ebelp,
          actual_total LIKE ekbe-wrbtr,
          END OF int_total.
    DATA: BEGIN OF int_excise OCCURS 0,
          ebeln      LIKE ekko-ebeln,
          kbetr      LIKE konp-kbetr,
          END OF int_excise.
    DATA: BEGIN OF int_rseg OCCURS 0,
          ebeln LIKE rseg-ebeln,
          ebelp LIKE rseg-ebelp,
          lfbnr LIKE rseg-lfbnr,
          matnr LIKE rseg-matnr,
          lfgja LIKE rseg-lfgja,
          belnr LIKE rseg-belnr,
          ecs LIKE j_1igrxref-ecs,
          beznk      LIKE    rbkp-beznk,
          wrbtr_f    LIKE  ekbz-wrbtr,
          rmwwr LIKE rbkp-rmwwr,
          END OF int_rseg.
    DATA: BEGIN OF int_rbkp OCCURS 0,
          belnr LIKE  rbkp-belnr,
          beznk      LIKE    rbkp-beznk,
          rmwwr      LIKE    rbkp-rmwwr,
          tcode  LIKE rbkp-tcode,
          END OF int_rbkp.
    ****ALV list definintion
    DATA: ws_cat TYPE slis_t_fieldcat_alv ,
          int_cat TYPE slis_t_fieldcat_alv WITH HEADER LINE.
    DATA: g_container TYPE scrfname VALUE 'BCALV_GRID_DEMO_0100_CONT1',
          g_custom_container TYPE REF TO cl_gui_custom_container.
    *selection-screen
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    SELECTION-SCREEN SKIP 2.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 19(23) text-002.
    SELECT-OPTIONS: s_lifnr FOR ekko-lifnr obligatory.
    *PARAMETERS:p_lifnr LIKE ekko-lifnr  .
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 25(17) text-006.
    *PARAMETERS:p_ebeln LIKE ekko-ebeln obligatory.
    SELECT-OPTIONS:s_ebeln FOR ekko-ebeln .
    SELECTION-SCREEN END OF LINE.
    *SELECTION-SCREEN BEGIN OF LINE.
    *SELECTION-SCREEN COMMENT 25(23) text-003.
    *PARAMETERS:p_ekorg LIKE ekko-ekorg.
    *SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    *SELECTION-SCREEN COMMENT 25(20) text-004.
    *PARAMETERS:p_werks LIKE ekpo-werks obligatory.
    *SELECT-OPTIONS: S_werks FOR ekpo-werks obligatory.
    SELECTION-SCREEN END OF LINE.
    *SELECTION-SCREEN BEGIN OF LINE.
    *SELECTION-SCREEN COMMENT 25(23) text-005.
    *SELECT-OPTIONS:s_bedat FOR ekko-bedat.
    *SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN END OF BLOCK b1.
    START-OF-SELECTION.
      PERFORM get_data.
      PERFORM field_catalog.
      PERFORM display_data.
    END-OF-SELECTION.
    *&      Form  get_data
    *       text
    FORM get_data.
    * start of Vender details
    ***vender no, vender name, po no,service/mat no, service/mat description
      SELECT  ekko~lifnr ekko~ebeln ekko~knumv ekko~bedat
              ekpo~werks ekpo~matnr ekpo~txz01 ekpo~werks
              ekpo~netwr
    *          ekpo~aedat
              ekbe~ebelp  ekbe~belnr
              lfa1~name1
      INTO    CORRESPONDING   FIELDS OF  TABLE int_outtab
      FROM ( ( ( ekko
               JOIN ekbe ON  ekbe~ebeln = ekko~ebeln AND
                             ekbe~vgabe = '2'       )
               JOIN ekpo ON ekpo~ebeln = ekko~ebeln   AND
                            ekpo~ebelp = ekbe~ebelp )
               JOIN lfa1 ON lfa1~lifnr = ekko~lifnr )
      WHERE
    *  ekko~lifnr  =  P_lifnr  AND
    *         ekko~ebeln IN  S_ebeln  AND
    **         ekpo~werks IN  S_werks AND
             ekbe~vgabe = '2'.
    ***WBS/Cost center
      SELECT  ebeln ebelp kostl ps_psp_pnr  FROM ekkn INTO int_ekkn
      FOR ALL ENTRIES IN int_outtab
      WHERE ebeln = int_outtab-ebeln AND
            ebelp = int_outtab-ebelp.
        APPEND int_ekkn.
      ENDSELECT.
      LOOP AT int_outtab.
        ON CHANGE OF int_outtab-ebeln OR int_outtab-ebelp.
          LOOP AT int_ekkn WHERE ebeln = int_outtab-ebeln AND
                                 ebelp = int_outtab-ebelp.
            IF  int_ekkn-kostl <> ' '.
              MOVE int_ekkn-kostl TO int_outtab-kostl.
            ELSE.
              MOVE int_ekkn-ps_psp_pnr TO int_outtab-kostl.
              " int_outtab-ps_psp_pnr.
            ENDIF.
          ENDLOOP.
          MODIFY int_outtab.
        ENDON.
      ENDLOOP.
    *end of Vender details*****
    *******Start of calculation of PO
    *****Excise calculation of po
      LOOP AT int_outtab.
        CONCATENATE int_outtab-werks int_outtab-lifnr int_outtab-matnr INTO
        ws_vakey.
        MOVE ws_vakey TO int_outtab-vakey.
        MODIFY int_outtab.
      ENDLOOP.
      LOOP AT int_outtab.
    *    ON CHANGE OF int_outtab-ebeln OR int_outtab-vakey.
        ON CHANGE OF int_outtab-ebelp.
          SELECT knumh kschl vakey FROM konh INTO int_konh
    *        FOR ALL ENTRIES IN int_outtab
            WHERE vakey = int_outtab-vakey AND
                  datab <= int_outtab-bedat AND
                  datbi > int_outtab-bedat AND
                 ( kschl = 'JMOP' OR kschl = 'JEC1' ).
            SELECT knumh kschl kbetr FROM konp INTO int_konp
            WHERE  knumh = int_konh-knumh .
              IF  int_konp-kschl = 'JMOP'.
                ws_kbetr = int_konp-kbetr / 1000 * int_outtab-netwr.
                ws_kbetr1 = ws_kbetr.
              ENDIF.
              IF int_konp-kschl = 'JEC1'.
                ws_kbetr2 = int_konp-kbetr / 1000 * ws_kbetr1.
              ENDIF.
              ws_kbetr = ws_kbetr + ws_kbetr2.
            ENDSELECT.
          ENDSELECT.
        ENDON.
    *    ENDON.
        MOVE ws_kbetr TO int_outtab-kbetr.
        MODIFY int_outtab.
        CLEAR: ws_kbetr, ws_kbetr1, ws_kbetr2.
      ENDLOOP.
      LOOP AT int_outtab.
    *    ON CHANGE OF int_outtab-ebeln OR int_outtab-vakey.
        int_excise-kbetr =  int_outtab-kbetr.
        int_excise-ebeln =  int_outtab-ebeln.
        APPEND int_excise.
    *    ENDON.
      ENDLOOP.
      LOOP AT int_outtab.
        ON CHANGE OF int_outtab-ebeln.
          LOOP AT int_excise WHERE ebeln = int_outtab-ebeln.
            ws_kbetr = ws_kbetr + int_excise-kbetr.
          ENDLOOP.
        ENDON.
        int_outtab-kbetr = ws_kbetr.
        MODIFY int_outtab.
        CLEAR ws_kbetr.
      ENDLOOP.
    ***** Insurance, Freight,Vat/ST, Other, Total***********
      LOOP AT int_outtab.
        ON CHANGE OF int_outtab-ebelp OR int_outtab-ebeln.
          CLEAR int_konv.
          SELECT * FROM konv INTO CORRESPONDING FIELDS OF int_konv
          WHERE knumv = int_outtab-knumv AND
                kposn = int_outtab-ebelp AND
              ( ( kschl <> 'RA00' )
                 AND ( kschl <> 'RA01' ) AND ( kschl <>  'RB00' )
                 AND ( kschl <> 'PBXX' ) AND ( kschl <>  'PB00' )
                 AND ( kschl <> 'RC00' ) AND ( kschl <>  'RL01' )
                 AND ( kschl <> 'ZC00' ) AND ( kschl <>  'ZA00' )
                 AND ( kschl <> 'ZA01' ) AND ( kschl <>  'HB01' )
                 AND ( kschl <> 'ZBED' ) AND ( kschl <>  'ZAED' )
                 AND ( kschl <> 'ZSED' ) AND ( kschl <>  'ZAE1' )
                 AND ( kschl <> 'ZSE1' ) AND ( kschl <>  'ZCEX' )
                 AND ( kschl <> 'ZPRO' ) AND ( kschl <>  'ZTRD' )
                 AND ( kschl <> 'ZPK4' ) AND ( kschl <>  'ZSTX' )
                 AND ( kschl <> 'ZASS' ) AND ( kschl <>  'ZJCD' )
                 AND ( kschl <>  'HB00') ).
            APPEND int_konv.
          ENDSELECT.
        ENDON.
      ENDLOOP.
      LOOP AT int_outtab.
        ON CHANGE OF int_outtab-ebelp OR int_outtab-knumv.
          LOOP AT int_konv WHERE kposn = int_outtab-ebelp AND
                                 knumv = int_outtab-knumv.
    *                             lifnr = int_outtab-lifnr.
    ***** tax
            IF  ( ( int_konv-kschl = 'NAVS' ) OR ( int_konv-kschl = 'NAVM' )
              int_outtab-kwert_t = int_outtab-kwert_t + int_konv-kwert.
            ELSE.
    *****freight
              IF ( ( int_konv-kschl = 'FRA1' ) OR ( int_konv-kschl = 'FRB1'
                                              OR  ( int_konv-kschl = 'FRC1'
                int_outtab-kwert_f = int_outtab-kwert_f + int_konv-kwert.
              ELSE.
    *****insurance
                IF ( ( int_konv-kschl = 'ZGIN' )  OR ( int_konv-kschl =
                'ZIN2' ) ).
                  int_outtab-kwert_i =  int_outtab-kwert_i + int_konv-kwert.
                ELSE.
    ****others
                  IF NOT (    ( int_konv-kschl = 'NAVS' ) OR (
                  int_konv-kschl = 'NAVM' )
                           OR ( int_konv-kschl = 'FRA1' ) OR (
                           int_konv-kschl = 'FRB1' )
                           OR ( int_konv-kschl = 'FRC1' ) OR (
                           int_konv-kschl = 'ZGIN' )
                           OR ( int_konv-kschl = 'ZIN2' ) OR (
                           int_konv-kschl = 'RA00' )
                           OR ( int_konv-kschl = 'RA01' ) OR (
                           int_konv-kschl = 'RB00' )
                           OR ( int_konv-kschl = 'PBXX' ) OR (
                           int_konv-kschl = 'PB00' )
                           OR ( int_konv-kschl = 'RC00' ) OR (
                           int_konv-kschl = 'RL01' ) ).
                    int_outtab-kwert_o =   int_outtab-kwert_o  +
                    int_konv-kwert.
                  ENDIF.
                ENDIF.
              ENDIF.
            ENDIF.
          ENDLOOP.
    ****total
          int_outtab-kwert_total =  int_outtab-kwert_t
                                    + int_outtab-kwert_f
                                    + int_outtab-kwert_i
                                    + int_outtab-kwert_o
                                  + int_outtab-netwr.
        ENDON.
        MODIFY int_outtab.
      ENDLOOP.
    ******End of calculation of PO
    *start of calculation for actual payment
    *****Excise
    sort int_outtab by ebelp ebeln.
      LOOP AT int_outtab.
        ON CHANGE OF int_outtab-ebelp OR int_outtab-ebeln.
          SELECT * FROM rseg INTO CORRESPONDING FIELDS OF int_rseg
    *          FOR ALL ENTRIES IN int_outtab
                 WHERE ebeln = int_outtab-ebeln AND
                       ebelp = int_outtab-ebelp.
            APPEND int_rseg.
          ENDSELECT.
        ENDON.
      ENDLOOP.
      sort int_rseg by ebelp lfbnr matnr.
      LOOP AT int_rseg.
        ON CHANGE OF int_outtab-ebelp OR int_rseg-lfbnr OR int_rseg-matnr OR
        int_rseg-lfgja.
          SELECT * FROM j_1ipart1 INTO wa_j_1ipart1
          WHERE mblnr = int_rseg-lfbnr AND
                mjahr = int_rseg-lfgja AND
                matnr = int_rseg-matnr.
            ON CHANGE OF wa_j_1ipart1-mblnr OR wa_j_1ipart1-zeile.
              SELECT * FROM j_1igrxref INTO wa_j_1igrxref
               WHERE mblnr = wa_j_1ipart1-mblnr AND
                     zeile = wa_j_1ipart1-zeile.
                IF sy-subrc EQ 0.
                  ws_ecs = ws_ecs + wa_j_1igrxref-exbed + wa_j_1igrxref-ecs.
                ENDIF.
              ENDSELECT.
            ENDON.
          ENDSELECT.
        ENDON.
        MOVE ws_ecs TO int_rseg-ecs.
        MODIFY int_rseg TRANSPORTING ecs.
        CLEAR: ws_ecs.
      ENDLOOP.
      LOOP AT int_outtab.
        ON CHANGE OF int_outtab-ebeln.
          LOOP AT int_rseg WHERE ebeln = int_outtab-ebeln.
            ws_ecs = ws_ecs + int_rseg-ecs.
          ENDLOOP.
        ENDON.
        MOVE ws_ecs TO int_outtab-ecs.
        MODIFY int_outtab TRANSPORTING ecs.
        CLEAR ws_ecs.
      ENDLOOP.
    ******unplanned costs and actual_invoice_total
      SORT int_rseg BY belnr.
      LOOP AT int_rseg .
        ON CHANGE OF int_rseg-belnr.
          SELECT  belnr beznk rmwwr tcode FROM rbkp INTO int_rbkp
          WHERE   belnr  = int_rseg-belnr .
            APPEND int_rbkp.
          ENDSELECT.
        ENDON.
      ENDLOOP.
      SORT int_rseg BY belnr.
      SORT int_rbkp BY belnr.
      LOOP AT int_rseg.
        ON CHANGE OF int_rseg-ebeln OR int_rseg-belnr.
          LOOP AT int_rbkp WHERE belnr = int_rseg-belnr.
            IF int_rbkp-tcode = 'MR8M'.
              int_rbkp-rmwwr = int_rbkp-rmwwr * ( - 1 ).
              int_rbkp-beznk = int_rbkp-beznk * ( - 1 ).
            ENDIF.
            ws_beznk =  ws_beznk + int_rbkp-beznk.
            ws_rmwwr =  ws_rmwwr + int_rbkp-rmwwr.
          ENDLOOP.
        ENDON.
        MOVE ws_beznk TO int_rseg-beznk.
        MOVE ws_rmwwr TO int_rseg-rmwwr.
        MODIFY int_rseg.
        CLEAR: ws_rmwwr, ws_beznk.
      ENDLOOP.
      LOOP AT int_outtab.
        ON CHANGE OF int_outtab-ebeln.
          LOOP AT int_rseg WHERE ebeln = int_rseg-ebeln.
            ws_beznk =  ws_beznk + int_rseg-beznk.
            ws_rmwwr =  ws_rmwwr + int_rseg-rmwwr.
          ENDLOOP.
        ENDON.
        MOVE ws_beznk TO int_outtab-beznk.
        MOVE ws_rmwwr TO int_outtab-rmwwr.
        MODIFY int_outtab.
        CLEAR: ws_rmwwr, ws_beznk.
      ENDLOOP.
    *freight of actual payment
      sort int_rseg by belnr ebelp.
      LOOP AT int_rseg.
        ON CHANGE OF  int_rseg-belnr or int_rseg-ebelp..
          SELECT * FROM ekbz INTO CORRESPONDING FIELDS OF int_ekbz
          WHERE ebeln = int_rseg-ebeln AND
                belnr = int_rseg-belnr AND
                ebelp = int_rseg-ebelp AND
                vgabe = '2' .
            IF int_ekbz-shkzg = 'H'.
              int_ekbz-wrbtr = int_ekbz-wrbtr  * ( - 1 ).
            ENDIF.
            int_rseg-wrbtr_f = int_rseg-wrbtr_f + int_ekbz-wrbtr.
          ENDSELECT.
        ENDON.
        MODIFY int_rseg.
        CLEAR int_rseg-wrbtr_f.
      ENDLOOP.
      sort int_rseg by ebelp.
      LOOP AT int_outtab.
        ON CHANGE OF int_outtab-ebeln OR int_outtab-ebelp.
          LOOP AT int_rseg WHERE ebeln = int_outtab-ebeln AND
                                 ebelp = int_outtab-ebelp.
            ws_wrbtr_f = ws_wrbtr_f + int_rseg-wrbtr_f.
          ENDLOOP.
        ENDON.
        MOVE ws_wrbtr_f TO int_outtab-wrbtr_f.
        MODIFY int_outtab TRANSPORTING wrbtr_f.
        CLEAR ws_wrbtr_f.
      ENDLOOP.
    **tax and gross amt of actual payment
      LOOP AT int_outtab.
        ON CHANGE OF int_outtab-ebelp OR int_outtab-ebeln.
        " or int_outtab-belnr.
          SELECT ebelp refwr wrbtr shkzg FROM ekbe INTO int_ekbe
          WHERE ebelp = int_outtab-ebelp AND
                ebeln = int_outtab-ebeln AND
                vgabe = '2' .
            IF int_ekbe-shkzg = 'H'.
              int_ekbe-refwr  = int_ekbe-refwr * ( - 1 ).
              int_ekbe-wrbtr  = int_ekbe-wrbtr * ( - 1 ).
            ENDIF.
            int_outtab-refwr_g = int_outtab-refwr_g +  int_ekbe-refwr.
            int_outtab-tax =  int_outtab-tax + ( int_ekbe-wrbtr -
            int_ekbe-refwr ).
          ENDSELECT.
        ENDON.
        MODIFY int_outtab.
        CLEAR int_outtab-refwr_g.
        CLEAR int_outtab-tax.
      ENDLOOP.
    ****total
      LOOP AT int_outtab.
        ON CHANGE OF int_outtab-ebelp  OR int_outtab-ebeln.
          int_outtab-actual_total =  int_outtab-actual_total
                                     + int_outtab-ecs
                                     + int_outtab-wrbtr_f
                                     + int_outtab-tax
                                     + int_outtab-beznk
                                     + int_outtab-refwr_g.
          int_total-actual_total =  int_outtab-actual_total.
          int_total-ebelp        = int_outtab-ebelp.
          int_total-ebeln        = int_outtab-ebeln.
          APPEND int_total.
        ENDON.
      ENDLOOP.
    *end of calculation for actaul payment
    *************Modification in internal table*****
      LOOP AT int_outtab.
        IF int_outtab-ebelp = ws_ebelp AND
           int_outtab-ebeln = ws_ebeln.
          int_outtab-netwr = 0.
          MODIFY int_outtab.
        ENDIF.
        ws_ebelp = int_outtab-ebelp.
        ws_ebeln = int_outtab-ebeln.
      ENDLOOP.
      LOOP AT int_outtab.
        IF int_outtab-netwr IS INITIAL.
          DELETE int_outtab INDEX sy-tabix.
        ENDIF.
      ENDLOOP.
      LOOP AT int_outtab.
        ON CHANGE OF int_outtab-ebeln.
          LOOP AT int_total WHERE ebeln = int_outtab-ebeln.
            int_outtab-actual_total =  int_outtab-actual_total
                                       + int_total-actual_total.
          ENDLOOP.
        ENDON.
        MODIFY int_outtab.
      ENDLOOP.
      LOOP AT int_outtab.
        SELECT SINGLE * FROM lfm1 INTO CORRESPONDING FIELDS OF int_outtab
        WHERE lifnr = int_outtab-lifnr.
        MODIFY int_outtab.
      ENDLOOP.
    ********** end of modification*********
    ENDFORM.                    "get_data
    *&      Form  field_catalog
    *       text
    FORM field_catalog.
    ***vender no
      int_cat-tabname       = 'INT_OUTTAB'.
      int_cat-fieldname     = 'LIFNR'.
      int_cat-reptext_ddic  = 'Vender No'.
      APPEND int_cat TO ws_cat.
    *vender name
      int_cat-tabname       = 'INT_OUTTAB'.
      int_cat-fieldname     = 'NAME1'.
      int_cat-reptext_ddic  = 'Vender Name'.
      APPEND int_cat TO ws_cat.
    ** PO No
      int_cat-tabname       = 'INT_OUTTAB'.
      int_cat-fieldname     = 'EBELN'.
      int_cat-reptext_ddic  = 'PO No'.
      APPEND int_cat TO ws_cat.
    ** Mat No
      int_cat-tabname       = 'INT_OUTTAB'.
      int_cat-fieldname     = 'MATNR'.
      int_cat-reptext_ddic  = 'Mat No'.
      APPEND int_cat TO ws_cat.
    ** Matdescription
      int_cat-tabname       = 'INT_OUTTAB'.
      int_cat-fieldname     = 'TXZ01'.
      int_cat-reptext_ddic  = 'Mat description'.
      APPEND int_cat TO ws_cat.
    **WBS/Cost center
      int_cat-tabname       = 'INT_OUTTAB'.
      int_cat-fieldname     = 'KOSTL'.
      int_cat-reptext_ddic  = 'WBS/Cost center'.
      APPEND int_cat TO ws_cat.
    **Currency
      int_cat-tabname       = 'INT_OUTTAB'.
      int_cat-fieldname     = 'WAERS'.
      int_cat-reptext_ddic  = 'Currency'.
      APPEND int_cat TO ws_cat.
    **Basic
      int_cat-tabname       = 'INT_OUTTAB'.
      int_cat-fieldname     = 'NETWR'.
      int_cat-reptext_ddic  = 'Basic'.
      APPEND int_cat TO ws_cat.
    **Excise
      int_cat-tabname       = 'INT_OUTTAB'.
      int_cat-fieldname     = 'KBETR'.
      int_cat-reptext_ddic  = 'Excise'.
      APPEND int_cat TO ws_cat.
    **Insurance
      int_cat-tabname       = 'INT_OUTTAB'.
      int_cat-fieldname     = 'KWERT_I'.
      int_cat-reptext_ddic  = 'Insurance'.
      APPEND int_cat TO ws_cat.
    **Frieght
      int_cat-tabname       = 'INT_OUTTAB'.
      int_cat-fieldname     = 'KWERT_F'.
      int_cat-reptext_ddic  = 'Frieght'.
      APPEND int_cat TO ws_cat.
    **VAT/ST
      int_cat-tabname       = 'INT_OUTTAB'.
      int_cat-fieldname     = 'KWERT_T'.
      int_cat-reptext_ddic  = 'VAT/ST'.
      APPEND int_cat TO ws_cat.
    **Other
      int_cat-tabname       = 'INT_OUTTAB'.
      int_cat-fieldname     = 'KWERT_O'.
      int_cat-reptext_ddic  = 'Others'.
      APPEND int_cat TO ws_cat.
    **Total
      int_cat-tabname       = 'INT_OUTTAB'.
      int_cat-fieldname     = 'KWERT_TOTAL'.
      int_cat-reptext_ddic  = 'Total'.
      APPEND int_cat TO ws_cat.
    ***Excise
      int_cat-tabname       = 'INT_OUTTAB'.
      int_cat-fieldname     = 'ECS'.
      int_cat-reptext_ddic  = 'Excise'.
      APPEND int_cat TO ws_cat.
    *****Freight
      int_cat-tabname       = 'INT_OUTTAB'.
      int_cat-fieldname     = 'WRBTR_F'.
      int_cat-reptext_ddic  = 'Freight'.
      APPEND int_cat TO ws_cat.
    *****Tax
      int_cat-tabname       = 'INT_OUTTAB'.
      int_cat-fieldname     =  'TAX'.
      int_cat-reptext_ddic  =  'Tax'.
      APPEND int_cat TO ws_cat.
    ***Unplanned Del Cost
      int_cat-tabname       = 'INT_OUTTAB'.
      int_cat-fieldname     = 'BEZNK'.
      int_cat-reptext_ddic  = 'Unplanned Del Cost'.
      APPEND int_cat TO ws_cat.
    ****Gross
      int_cat-tabname       = 'INT_OUTTAB'.
      int_cat-fieldname     = 'REFWR_G'.
      int_cat-reptext_ddic  = 'Gross'.
      APPEND int_cat TO ws_cat.
    **Total
      int_cat-tabname       = 'INT_OUTTAB'.
      int_cat-fieldname     = 'ACTUAL_TOTAL'.
      int_cat-reptext_ddic  = 'Total'.
      APPEND int_cat TO ws_cat.
    **Actual Invoice Total
      int_cat-tabname       = 'INT_OUTTAB'.
      int_cat-fieldname     = 'RMWWR'.
      int_cat-reptext_ddic  = 'Actual Invoice Total'.
      APPEND int_cat TO ws_cat.
    ENDFORM.                    "field_catalog
    *&      Form  display_data
    *       text
    FORM display_data.
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
        EXPORTING
          i_callback_program = 'Z_MM_TEST1'
          it_fieldcat        = ws_cat[]
        TABLES
          t_outtab           = int_outtab
        EXCEPTIONS
          program_error      = 1
          OTHERS             = 2.
    ENDFORM.                    "display_data
    Reward for all helpfull answers
    Regards
    Pavan

  • Need help for ABAP CODE

    hi,
    i need to reload the master data without FM, i put the comments on fm and relaod the data, now i having a problem, loading process is slow now as compair to before, when i was using with FM.i checked the manage of infoObject, it is show 1123455 records in "transfer" column and 0 record in "added" column, below is the start routine,
    Please help me to fix that problem
    IF NOT DATAPAK[] IS INITIAL.
        LOOP AT DATAPAK INTO S_DATAPAK.
          CLEAR V_INDEX.
          V_INDEX = SY-TABIX.
         IF S_DATAPAK-/BIC/ABRETPRI CO ' 0123456789.'.
           CLEAR: V_AMOUNT, V_PRC.
          V_AMOUNT = S_DATAPAK-/BIC/ABRETPRI.
          CALL FUNCTION 'RSAR_CURRENCY_CONVERT'
          EXPORTING
          I_CURRENCY = S_DATAPAK-CURRENCY
          CHANGING
          C_AMOUNT   = V_AMOUNT.
         V_PRC = V_AMOUNT.
         S_DATAPAK-/BIC/ABRETPRI = V_PRC.
        ENDIF.
    IF S_DATAPAK-/BIC/ABBLNKFLG IS INITIAL.
            S_DATAPAK-/BIC/ABBLNKFLG = 'N'.
          ENDIF.
    TRANSLATE S_DATAPAK-/BIC/ABSZRANGE TO UPPER CASE
    IF S_DATAPAK-CURRENCY IS INITIAL.
          S_DATAPAK-CURRENCY = S_DATAPAK-WHLPRCCURR.
    MODIFY DATAPAK FROM S_DATAPAK INDEX V_INDEX TRANSPORTING
         /BIC/ABRETPRI /BIC/ABWHLPRCE /BIC/ABBLNKFLG
         ENDIF.
    *ENDLOOP.
      ENDIF
    Thanks

    You need not use start routine to achieve this. Instead you can write transfer routines/formulas for those fields in UR.

  • Need help in writing coding in HTML?

    HI All
    I have requirement like this.
    1st RFC i pass Plant and i will get trasportation point.
    in display template i need to display trasportation point in dropdown box and user will select the trasportation point and iam passing this trasportation  to aother RFC and gettting shipment cost.
    i need help in how to write coding in .IRPT
    i created the transactions for both the RFC and its working fine.First RFC iam getting trasportaion point ...i created Xecute query.
    I need how to display !st one in dropdown box and pass that data into 2nd RFC.
    Regards,
    Phani

    Phani,
    You have to use the iBrowser displaytemplate.
    Map the transportion point Xacute qquery in iBrowser displaytemplate.
    In code use : 
    document.APP1.getBrowserObject().getSelectedItem();
    Store the value of above code in a variable.
    And pass this variable in other appalet which displays the R/3 details as below:
    document.APP2.getQueryObject().setParam(1,var);
    document.APP2.refresh();
    -Suresh

  • Abap code in start routine

    hi,
    i have a code in this way in update routine of that info object
    instead of writng that code in update routine i want to write in start routine
    can any one tell me what r the changes i have to made
    please suggest me
    i will assigfn points
    CASE COMM_STRUCTURE-crm_ctstat.
    Contact Achieved
        WHEN '0'.
    Finished faultless
          RESULT = '20'.
          RETURNCODE = 0.
    Contact Not Possible (Missing Communication Data)
        WHEN '1'.
    Finished faulty
          RESULT = '10'.
          RETURNCODE = 0.
    Contact Not Possible (Incorrect Communication Data)
        WHEN '2'.
    Finished faulty
          RESULT = '10'.
          RETURNCODE = 0.
    Contact Not Permitted (Max. Usage BP List)
        WHEN '3'.
    Finished faulty
          RESULT = '10'.
          RETURNCODE = 0.
    Contact Not Permitted (Block Indicator for BP)
        WHEN '4'.
    Finished faulty
          RESULT = '10'.
          RETURNCODE = 0.
    Contact Not Possible (Technical Problems)
        WHEN '5'.
    Finished faulty
          RESULT = '10'.
          RETURNCODE = 0.
      ENDCASE.

    Hi,
    loop at datapackage.
    CASE datapackage-crm_ctstat.
    Contact Achieved
    WHEN '0'.
    Finished faultless
    RESULT = '20'.
    RETURNCODE = 0.
    Contact Not Possible (Missing Communication Data)
    WHEN '1'.
    Finished faulty
    RESULT = '10'.
    RETURNCODE = 0.
    Contact Not Possible (Incorrect Communication Data)
    WHEN '2'.
    Finished faulty
    RESULT = '10'.
    RETURNCODE = 0.
    Contact Not Permitted (Max. Usage BP List)
    WHEN '3'.
    Finished faulty
    RESULT = '10'.
    RETURNCODE = 0.
    Contact Not Permitted (Block Indicator for BP)
    WHEN '4'.
    Finished faulty
    RESULT = '10'.
    RETURNCODE = 0.
    Contact Not Possible (Technical Problems)
    WHEN '5'.
    Finished faulty
    RESULT = '10'.
    RETURNCODE = 0.
    ENDCASE.
    endloop.

  • Need help on logic/ coding

    Dear all,
    I need help on , How to compare two lists? I wrote the following code. but I'm not success. please help.
    declare
    rec_cnt number;                             --This for getting first record set count
    pd_cnt  number;                              -- This for getting second  record set count
    flg_tst char(1):='F';                      -- this flag  is set to false.
    begin             
          go_block('block1');                     -- In this block displays my first  list         
          last_record;                                 -- cursor Point out the last record.
          rec_cnt := :system.cursor_record;        -- here getting total number of records in the first list
          go_block('block2');                        -- In this block displays my second  list        
          last_record;                                 -- cursor Point out the last record.
          pd_cnt := :system.cursor_record;        -- here getting total number of records in the  second list
          begin   
               /* go_block('block1');
               first_record; */
               for i in 1..rec_cnt
               loop                                         /* Here my comparison  of records going on. for every record in  first list there  should be
                                                           corresponding record in second record.
                                         otherwise should throw message.
                                         suppose if one record is not matched then the control should exit from the two loops and throws the message */
                      go_block('block1');                              
                      go_record(i);
                      go_block('block2');
                      first_record;
                         for j in 1..pd_cnt
                         loop
                               if :block1.TEST_ID =:block2.TEST_CODE then     /*If two records match set the flag as True and exit from second loop. there is no need to further check. */
                                        flg_tst := 'T';                /* And loops should take next record from second list, again loops goes for second list record matching */
                                        exit;
                                  else
                                       if j != pd_cnt then       /*not match then compare with next record of the second record */                            
                                           next_record;
                                       end if;          
                                  end if;    
                         end loop;   
                      if (flg_tst := 'F' and j=pd_cnt) then     /*suppose one record in first list is not equal with all records in second list,exit from second loop and shows message */
                   exit;
                      elsif (flg_tst := 'F' and i != rec_cnt) then
                               next_record;
                      else
                           exit;
                      end if;   
                end loop;
               if flg_tst = 'F' then
                            message('For mu test no corresponding test code');                  
                      end if;
              /* Exception when others then
               message('HI:=  '||sqlerrm);
               message('HI:=  '||sqlerrm); */
          end ;
    end;
          My problem is :
    1. we should take one record from firstlist and compare with all records in second list.
    --> suppose match then,we should continue for next record for first list.
    -->not match then exit from two loops and shows error.
    2. we should compare all the records in first list with all records in second list.
    Thanks
    SB
    Edited by: SB on Dec 7, 2011 1:31 AM

    Hi all,
    Now I've changed my query as follows,
    PROCEDURE testing IS
    rec_cnt number:=0;
    pd_cnt  number:=0;
    flg_tst char(1);
    begin
          go_block('med_uw');
          last_record;
          rec_cnt := :system.cursor_record;
          go_block('panel_doctor');
          last_record;
          pd_cnt := :system.cursor_record;
          message('rec_cnt'||rec_cnt||'  '||'pd_cnt'||pd_cnt);
          message('rec_cnt'||rec_cnt||'  '||'pd_cnt'||pd_cnt);
           begin
               for j in 1..pd_cnt
               loop
                      flg_tst:='F';
                      go_block('panel_doctor');
                      go_record(j);
                      go_block('med_uw');
                      first_record;
                         for i in 1..rec_cnt
                         loop 
                                    if :block2.TEST_ID =: block1.TEST_CODE then
                                        flg_tst := 'T';
                                        exit;
                                  else
                                       next_record;
                                end if;          
                         end loop;   
                      if (flg_tst = 'F')then
                              exit;
                         else
                           next_record;
                      end if;   
               end loop;
            if flg_tst = 'F' then
                                message('For'||'  '||:block1.PD_DOC_CODE||' '|| 'doc code med test has not been added, please add the test or delete the doc code');                  
            end if;
          end ;
    end;
          but still the problem persist.
    Edited by: SB on Dec 7, 2011 5:22 AM

Maybe you are looking for