Update of segment field in bseg table

hi
can any explain me about update of segment field in bseg table
segment is mentained in profit center master record ,and i want to generate trial balance segment wise and profit center wise
please suggest me steps to do in a new gl senario
thanks
cb

Hi,
You need to activate the assign scenarion FIN_SEGM to your ledgers in the below path:-
SPRO> Financial Accounting (New) > Financial Accounting Global Settings (New) > Ledgers > Ledger > Assign Scenarios and Customer Fields to Ledgers
Then you need to make document splitting characteristics based on Segment field in the below path:-
SPRO> Financial Accounting (New) > General Ledger Accounting (New) > Business Transactions > Document Splitting > Define Document Splitting Characteristics for General Ledger Accounting
Make the below entry:-
Field = SEGMENT
Zero Balance = Selected
Partner Field = PSEGMENT
Mandatory Field = Selected
Then you will be able to generate the balance sheet segment wise in report S_PL0_86000028 "Financial Statement: Actual/Actual Comparison". (Similar steps you can use for profir center wise balance sheet in addition.)
Regards,
Gaurav

Similar Messages

  • Bapi or function module to update rstgr field in bseg table

    what is the bapi or function module used to update the fields in bseg table particularly "rstgr" field?

    Hi,
    Use Bapi
    BAPI_ACC_DOCUMENT_POST
    Regards,
    Prashant

  • Update a field in bseg table

    Hi experts,
    i want to update a field in BSEG  table (field name is BUPLA).
    Using UPDATE statement i am going to update the bseg table.
    I know only update statement.
    This my immediate requirement.
    please give me suggesstion.

    Hi,
    If you want to update the existing table record or field.. it is always advisable to use MODIFY statement instead of  UPDATE.
    syntax: 
    fetch the BSEG data to internal table IT_BSEG and do you modificaltions.
    Loop at it_bseg.
        it_bseg- XYZ = 'ABC'.
        it_bseg-UVW = '123'.
       modify it_bseg transporting XYZ  UVW .
    endloop.
    MODIFY BSEG FROM TABLE IT_BSEG   (here it_bseg is the internal table)
    COMMITWORK.
    Modify always check in the database whether the record exists or not if it is there it will modify the existing one.. otherwise create a new record.... in Update statement.. there is always a chance of creating a new record.. instead of updating the existing one...

  • Updation of Custom Fields in AFRU table Using Customerexit

    Hi all,
    I added two fields in CO11n Tcode using SCREEN EXIT - CONFPP07 and iam trying to update these two fields in AFRU table
    using CONFPP05.  But iam unable to update these two field .
    see this code in CONFPP05
      LOOP AT afrud_tab.
        afrud_tab-zzshift = wa_afrud-zzshift1 .
        afrud_tab-zzoperator = wa_afrud-zzoperator1 .
        MODIFY afrud_tab.
      ENDLOOP.
    Plz help me regarding this..

    Thanks for reply
    Ya i added two fields in confpp07 .
    see the code :
    *&  Include           ZXCOFTOP
    tables : afrud.
    DATA : WA_AFRUD TYPE AFRUD,
            IT_AFRUD TYPE TABLE OF AFRUD.
    Include           ZXCOFU24
    MOVE afrud-zzshift1 TO wa_afrud-zzshift1.
    MOVE afrud-zzoperator1 TO wa_afrud-zzoperator1.
    Even though it is not updating . except these two fields.
    Regards,
    Srinivas

  • Update Yes/No field in access table through oracle procedure

    Hi,
    How to update Yes/No field in access table through oracle procedure. all other fields like AutoNumber, Text I can update it. Yes/No field how to update? Please, any one can help me?
    Thanks and Regards,
    Sudha.

    Sudha Teki wrote:
    select "fldPost" from tblPHd@ODBCLNKNot quite sure what you mean, but the way you select the column would indicate a case sensitive column name
    Look at this example
    SQL> create table t
      2  ("this" varchar2(10))
      3  /
    Table created.
    SQL> insert into t values ('hello')
      2  /
    1 row created.
    SQL> select *
      2    from t
      3  /
    this
    hello
    SQL> select this
      2    from t
      3  /
    select this
    ERROR at line 1:
    ORA-00904: "THIS": invalid identifier
    SQL> select "this"
      2    from t
      3  /
    this
    helloIs your column name also case sensitive?

  • Update the Street field in ADRC table.

    Hello !! Please I need some help.
    I have to update the Street field in ADRC table.
    I have this list.
    Where I can put a Flag and an Update to do it.
    Im really newbie.  Im doing it in IDES, to test it first.
    Help !
    REPORT  Z_LIST_ADRC      LINE-SIZE 190
                             LINE-COUNT 65
                             NO STANDARD PAGE HEADING.
    TABLES: ADRC.
    DATA: BEGIN OF ITAB OCCURS 0,
               ADDRNUMBER LIKE ADRC-ADDRNUMBER,
               date_to like ADRC-date_to,
               NAME1 LIKE ADRC-NAME1,
               CITY1 LIKE ADRC-CITY1,
               CITY2 LIKE ADRC-CITY2,
               STREET LIKE ADRC-STREET,
               MC_NAME1 LIKE ADRC-MC_NAME1,
               MC_CITY1 LIKE ADRC-MC_CITY1,
               MC_STREET LIKE ADRC-MC_STREET,
    END OF ITAB.
    SELECT ADDRNUMBER DATE_TO NAME1 CITY1 CITY2 STREET MC_NAME1 MC_CITY1 MC_STREET
      FROM ADRC INTO TABLE ITAB.
    LOOP AT ITAB.
    WRITE : /001 ITAB-ADDRNUMBER,
                    007 ITAB-DATE_TO,
                    016 ITAB-NAME1,
                    040 ITAB-CITY1,
                    070 ITAB-CITY2,
                    090 ITAB-STREET,
                    120 ITAB-MC_NAME1,
                    150 ITAB-MC_CITY1,
                    170 ITAB-MC_STREET.
    ENDLOOP.
    TOP-OF-PAGE.
      ULINE.
        WRITE:         /001 'n-addr',
                        007 'date',
                        016 'name',
                        040 'city1',
                        070 'city2',
                        090 'street',
                        120 'name-s',
                        150 'city1-s',
                        170 'city2-s'.
      ULINE.

    HI,
    data : itab like standard table of adrc.
    select * from adrc into table itab.
    loop at itab.
    itab-street2 = 'New value'.
    modify itab index sy-tabix.
    endloop.
    if not itab[] is initial.
    modify adrc from table itab.
    endif.

  • How to update a custom field of MARC table using BAPI_MATERIAL_SAVEREPLICA

    Hi,
    I want to update a custom field (Appended field) of MARC table using  BAPI_MATERIAL_SAVEREPLICA. Please help me in this issue. I cannot use BAPI_MATERIAL_SAVEDATA as this updated the MARC table record by record. I have to update bulk records at a time.
    Thanks
    Rahul.

    Hi,
    Use the Documentation given for struture in BAPI docuemntation...
    For loading data into custom fields of MARC use the structure - BAPI_TE_MARC.
    First, structures BAPI_TE_<NAME> (<NAME> = MARA, MARC, MARD, MBEW, MLGN, MLGT, MVKE, MARM, MAKT) and the appropriate check structures BAPI_TE_<NAME> (<NAME> = MARAX, for example) have to be extended by the customer to include the required fields. The structures that are delivered as standard only contain the relevant key fields. When new fields are added to this structure, you should ensure that a field has the same name as the field in the database table. Furthermore, the fields in the structures BAPI_TE_<NAME> can only be CHARACTER fields. Data element BAPIUPDATE is to be used for the fields in the check structure (exception to this: key fields.)
    Parameters EXTENSIONIN and EXTENSIONINX are used for transferring data to the method. Field STRUCTURE contains the name of the structure (for example, BAPI_TE_MARA or BAPI_TE_MARAX). This names is used to identify the work area (for example,  WA_BAPI_TE_MARA or WA_BAPI_TE_MARAX) to which the data is transferred. The remaining fields in parameters EXTENSIONIN or EXTENSIONINX contain data for the key fields (for example, the material number) and the data for customer-specific fields. The number of characters reserved in both parameters for the contents of the customer-specific fields must match the number of characters for the relevant field in the work area. If the number of required characters is less, the remaining characters are left blank. Only when all characters have been filled can the contact for an additional field be transferred. Bear in mind that only data for which an appropriate indicator has been set in the work area can be updated to the database.
    Regards,
    Bhargava

  • Problem with update of BLOB field in a table with compound primary key

    Hi,
    I've been developing an application in Application Express 3.1.2.00.02 that includes processing of BLOB data in one of the tables (ZPRAVA). Unfortunately, I've come across a strange behaviour when I tried to update value in a BLOB field for an existing record via a DML form process. Insert of a new record including the BLOB value is OK (the binary file uploads upon submiting the form without any problems). I haven't changed the DML process in any way. The form update process used to work perfectly before I'd included the BLOB field. Since than, I keep on getting this error when trying to update the BLOB field:
    ORA-20505: Error in DML: p_rowid=3, p_alt_rowid=ID, p_rowid2=CZ000001, p_alt_rowid2=PR_ID. ORA-01008: not all variables bound
    Unable to process row of table ZPRAVA.
    OK
    Some time ago, I've already created another application where I used similar form that operated on a BLOB field without problems. The only, but maybe very important, difference between both the cases is that the first sucessfull one is based on a table with a standard one-column primary key whereas the second (problematic one) uses a table with compound (composite) two-column PK (two varchar2 fields: ID, PR_ID).
    In both cases, I've followed this tutorial: [http://www.oracle.com/technology/obe/apex/apex31nf/apex31blob.htm]).
    Can anybody confirm my suspicion that Automatic Row Processing (DML) can be used for updating BLOB fields within tables with only single-column primary keys?
    Thanks in advance.
    Zdenek

    Is there a chance that the bug will be included in the next patch?No, this fix will be in the next full version, 3.2.
    Scott

  • Updation of 'Z' field in database table VBAP & AUFK

    Hi,
    In my report I wanted to update/modify value in a "Z" field in VBAP and a "Z" field in AUFK table.
    Could anyone please suggest me how to update/modify this field value using a BAPI or FM?
    Or any other method atleast..
    Thanks in Advance,
    Rohan.

    Hi,
    When you want to change the Zfield in VBAP we can go for the BAPI function module-
    BAPI_SALESORDER_CHANGE for the given Zfield get the header data and append it to BAPI header structure.
    I think we may use the same FM for updating the AUFK also.
    Reward points if useful.
    Regards
    Chandralekha

  • Move fields in bseg table

    Hi
    Below is my bseg table data. My requirement is  if   line item 1 of zuonr is space i want to get this value from line 2 of kunnr.
    BUKRS   BELNR        GJAHR    BUZEI    ZUONR      KUNNR
    7063       0140951570  2009       001
    7063   0140951570 2009  002   0000017017         0000055555
    my output will be
    BUKRS   BELNR        GJAHR    BUZEI    ZUONR      KUNNR
    7063       0140951570  2009       001   0000055555     
    7063   0140951570 2009  002   0000017017         0000055555

    Hi Kumar,
    Define one more table (itab2) of same structure.
    Loop at 1st table.
    Itab2-bukrs = itab1-bukrs.
    Itab2-belnr = itab1-belnr.
    Itab2-gjahr = itab1-gjahr.
    Itab2-bezei = itab1-bezei.
    If itab1-zuonr = space.
    Itab2-zuonr = itab1-kunnr.
    Else.
    Itab2-zuonr = itab1-zuonr.
    Endif.
    Append itab2.
    Endloop.
    Hope this will help you.
    Best Regards,
    Deepa Kulkarni

  • Update Condition Category field in KONV table

    hello Folks,
    I have a requiremnt to update the Condition Category of KONV table .. I don't want to use direct table update
    I have used the below Bapi's but nothing is working
    1>BAPI_SALESORDER_CHANGE and got the message
    Manual changes to condition type is not permitted
    2>SD_SALES_CONDITION_MAINTAIN
    3>SD_SALES_ITEM_COND_MAINTAIN
    Please let me know if any FM is there to update the same.
    Your help is highly appreciated.
    Regards,
    Raj

    Make use of the following functionModule  to add,delete and update
    CALL FUNCTION 'KONV_UPDATE'
    EXPORTING
    PI_UPDKZ = PI_UPDKZ
    TABLES
    PI_T_KONV = WA_KONV .
    PI_UPDKZ = 'D' (Delete) ,'I' (Insert) ,'U' (Update)

  • Updating custom fields in BSEG table

    Hi Experts,
    I searched through SDN but did not find satisfactory answer to my problem.
    The scenario is that FIDCC2 Idoc is coming to SAP system. This Idoc has extended to include few custom fields. These fields need to be updated in table BSEG. Table BSEG also contains these custom fields. However, the Idoc processing routine is not updating custom fields in table BSEG with the data coming in Idoc. How can I do that?
    Thanks in advance,
    Netrey

    This message is processed by function module IDOC_INPUT_FIDCC2. If you drill down into the code a little bit, you should be able to find BTE/open FI or user exit calls (CALL CUSTOMER-FUNCTION) before the document is being posted.
    I found two that are using the ACCIT structure for passing the line items, which should contain your customer fields as well, if they were added to BSEG properly (via transaction OXK3).
    Please have a look.
    Thomas

  • Updation of blank field in internal table

    Hi,
      I want to update the blank businees area field with the header item of that particular business area belnr.
    i am sending you the updation of business area code plz find out where rhe error and rectify please.
    points given
    REPORT zfir_vendorwise_grir_balances NO STANDARD PAGE HEADING
                            LINE-SIZE 142
                            LINE-COUNT 65.
    TABLES: bsis,bkpf,bseg,ekko,lfa1.
    TYPE-POOLS: slis.
    CONSTANTS:
    gc_formname_top_of_page TYPE slis_formname VALUE 'TOP_OF_PAGE'.
    DATA: gt_fieldcat TYPE slis_t_fieldcat_alv,
          gs_layout   TYPE slis_layout_alv ,
          gs_print    TYPE slis_print_alv,
          gt_sort     TYPE slis_t_sortinfo_alv ,
          gt_filter   TYPE slis_t_filter_alv,
          gt_sp_group TYPE slis_t_sp_group_alv,
          gt_alv_graphics TYPE dtc_t_tc,
          gt_excluding  TYPE slis_t_extab ,
          gt_events   TYPE slis_t_event .
    DATA: g_repid LIKE sy-repid.
    DATA: gt_list_top_of_page TYPE slis_t_listheader.
    DATA:       g_boxnam TYPE slis_fieldname VALUE  'BOX',
                p_f2code LIKE sy-ucomm       VALUE  '&ETA',
                p_lignam TYPE slis_fieldname VALUE  'LIGHTS',
                g_save(1) TYPE c,
                g_default(1) TYPE c,
                g_exit(1) TYPE c,
                gx_variant LIKE disvariant,
                g_variant LIKE disvariant.
    DATA : g_user_command(30) VALUE 'USER_COMMAND'.
    DATA : g_status_set(30)  VALUE 'PF_STATUS_SET'.
    DATA: BEGIN OF it_final OCCURS 0,
          awkey TYPE awkey,
          grir(10) TYPE c,
          bukrs LIKE bsis-bukrs,
          hkont LIKE bsis-hkont,
          gjahr LIKE bsis-gjahr,
          belnr LIKE bsis-belnr,
          budat LIKE bsis-budat,
          waers LIKE bsis-waers,
          xblnr LIKE bsis-xblnr,
          blart LIKE bkpf-blart,
          buzei like bseg-buzei,
          bschl LIKE bseg-bschl,
          shkzg LIKE bseg-shkzg,
          gsber LIKE bseg-gsber,
          dmbtr LIKE bseg-dmbtr,
          wrbtr LIKE bsis-wrbtr,
          sgtxt LIKE bseg-sgtxt,
          ebeln LIKE bseg-ebeln,
          lifnr LIKE ekko-lifnr,
          ps_psp_pnr LIKE ekkn-ps_psp_pnr,
          name1 LIKE addr1_data-name1,
          END OF it_final.
    DATA : it_po LIKE it_final OCCURS 0 WITH HEADER LINE.
    DATA : it_ebeln LIKE it_final OCCURS 0 WITH HEADER LINE.
    DATA : it_awkey LIKE it_final OCCURS 0 WITH HEADER LINE.
    DATA : wa_final LIKE LINE OF it_final.
    DATA : BEGIN OF it_lifnr OCCURS 0,
            ebeln TYPE ebeln,
            lifnr TYPE lifnr,
    END OF it_lifnr.
    DATA : BEGIN OF it_name1 OCCURS 0,
            lifnr TYPE lifnr,
            name1 TYPE name1,
    END OF it_name1.
    DATA : hmin TYPE bseg-hkont.
    DATA : hmax TYPE bseg-hkont.
    DATA: idx TYPE sy-tabix.
    DATA:  temp_gsber TYPE bseg-gsber.
    DATA:  temp_ebeln TYPE bseg-ebeln.
    DATA : temp_gjahr TYPE bseg-gjahr.
    DATA : temp_belnr TYPE bseg-belnr.
    DATA : temp_lifnr TYPE bseg-lifnr.
    *DEFINING THE SELECTION-CRITERIA.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    PARAMETERS: p_bukrs LIKE skb1-bukrs OBLIGATORY.
    SELECT-OPTIONS: s_gsber FOR bseg-gsber OBLIGATORY.
    SELECT-OPTIONS: s_hkont FOR bseg-hkont OBLIGATORY.
    PARAMETERS: p_lifnr LIKE ekko-lifnr.
    PARAMETERS: p_budat LIKE bkpf-budat OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK b1.
    AT SELECTION-SCREEN ON s_hkont.
      CHECK s_hkont-low LT 250301 OR s_hkont-high GT 250500.
      MESSAGE e000(zm) WITH 'PLEASE SELECT A GRIR CLEARING ACCOUNT BETWEEN'
                            '250301 AND 250500'.
    *INITIALIZATION.
    INITIALIZATION.
      g_repid = sy-repid.
    *START-OF-SELECTION.
    START-OF-SELECTION.
      PERFORM select_data.
      PERFORM display_data.
      PERFORM list_display.
    *&      Form  select_data
          text
    -->  p1        text
    <--  p2        text
    FORM select_data .
    *selecting open item details
      SELECT bukrs  hkont  gjahr   belnr buzei
             budat  waers  xblnr   blart
             bschl  shkzg  gsber   dmbtr
             wrbtr  sgtxt
         FROM bsis
            INTO CORRESPONDING FIELDS OF TABLE it_final
            WHERE bukrs EQ p_bukrs
                  AND hkont BETWEEN  '0000250301' AND  '0000250500'
                  AND budat LE p_budat AND ( blart EQ 'WE' OR
                                             blart EQ 'RE' OR
                                             blart EQ 'SA' OR
                                             blart EQ 'EI').
    *selecting closed/cleared item details
      SELECT bukrs  hkont gjahr belnr buzei budat
             waers  xblnr blart bschl shkzg
             gsber  dmbtr wrbtr sgtxt
         FROM bsas
            APPENDING CORRESPONDING FIELDS OF TABLE it_final
            WHERE bukrs EQ p_bukrs
            AND hkont BETWEEN '0000250301' AND  '0000250500'
            AND budat LE p_budat
            AND blart IN ('WE', 'RE','SA','EI')
            AND augdt GE p_budat.
      SORT it_final BY belnr gsber DESCENDING.
      CLEAR: temp_belnr, temp_gsber.
    update blank business areas
    LOOP AT it_final .
    IF temp_gsber IN s_gsber AND it_final-belnr = temp_belnr.
         IF it_final-gsber = ' '.
           it_final-gsber = temp_gsber.
         ENDIF.
       ENDIF.
    if it_final-gsber eq space or it_final-gsber in s_gsber.
         wa_final-gsber = it_final-gsber.
         wa_final-belnr = it_final-belnr.
         modify it_final from wa_final transporting gsber.
    else.
         wa_final-gsber = it_final-gsber.
         wa_final-belnr = it_final-belnr.
         modify it_final from wa_final transporting gsber.
    endif.
    *clear wa_final.
    endloop.
    LOOP AT it_final.
       IF temp_gsber IN s_gsber AND it_final-belnr = temp_belnr.
         IF it_final-gsber = ' '.
           it_final-gsber = temp_gsber.
         ENDIF.
         IF it_final-lifnr = ' '.
           it_final-lifnr = temp_lifnr.
         ENDIF.
         IF it_final-belnr = ' '.
           it_final-belnr = temp_belnr.
         ENDIF.
       ENDIF.
       IF it_final-gsber EQ space OR it_final-gsber IN s_gsber.
         CLEAR: temp_belnr, temp_gsber,temp_lifnr.
         temp_belnr = it_final-belnr.
         temp_gsber = it_final-gsber.
         temp_lifnr = it_final-lifnr.
       ELSE.
         CLEAR : temp_belnr, temp_gsber,temp_lifnr.
       ENDIF.
       MODIFY it_final TRANSPORTING gsber.
    ENDLOOP.
      sort it_final by belnr buzei.
    loop at it_final.
    on change of it_final-belnr.
    clear temp_belnr.
    clear temp_gsber.
    clear temp_lifnr.
    temp_belnr = it_final-belnr.
    temp_gsber = it_final-gsber.
    temp_lifnr = it_final-lifnr.
    endon.
    if it_final-gsber is initial.
      it_final-gsber = temp_gsber.
    *modify it_final transporting gsber.
    endif.
    if it_final-lifnr is initial.
      it_final-lifnr = temp_lifnr.
    *modify it_final transporting lifnr.
    endif.
    modify it_final transporting gsber lifnr where belnr = temp_belnr.
    endloop.
    *deleting entries which are not as per input parameter for business area
    DELETE it_final WHERE  gsber NOT IN s_gsber .
    loop at it_final.
      if s_gsber-low ne '' and s_gsber-high ne ''.
      delete it_final where gsber not in s_gsber.
    elseif s_gsber-low ne '' and s_gsber-high eq ''.
    delete it_final  where gsber ne s_gsber-low.
    endif.
    endloop.
    *initialising internal tables
      it_awkey[] = it_final[].
      it_po[] = it_final[].
      it_ebeln[] = it_final[].
      IF it_final[] IS NOT INITIAL.
    *selecting purchase doc details
        SELECT bukrs  hkont  gjahr   belnr
                       bschl  shkzg  gsber   dmbtr
             wrbtr  sgtxt ebeln
               FROM bseg  INTO CORRESPONDING FIELDS OF TABLE it_ebeln
               FOR ALL ENTRIES IN it_final
                WHERE bukrs = p_bukrs
                  AND belnr = it_final-belnr
                  AND gjahr = it_final-gjahr
                  AND hkont = it_final-hkont.
    *selecting the GR/IR number from BKPF
        SELECT  bukrs    gjahr   belnr
             budat  waers  xblnr   blart
             awkey
            FROM bkpf
          INTO CORRESPONDING FIELDS OF  TABLE it_awkey
              FOR ALL ENTRIES IN it_final
        WHERE bukrs EQ it_final-bukrs
              AND gjahr EQ it_final-gjahr
              AND belnr EQ it_final-belnr.
      ENDIF.
      IF it_ebeln[] IS NOT INITIAL.
    *selecting WBS element
        SELECT   ebeln  gsber
              ps_psp_pnr
          FROM ekkn
          INTO CORRESPONDING FIELDS OF TABLE it_po
          FOR ALL ENTRIES IN it_ebeln
          WHERE ebeln = it_ebeln-ebeln.
    *selecting vendor
        SELECT bukrs ebeln lifnr
          FROM ekko
          INTO CORRESPONDING FIELDS OF TABLE it_lifnr
          FOR ALL ENTRIES IN it_ebeln
          WHERE ebeln = it_ebeln-ebeln.
      ENDIF.
      IF it_lifnr[] IS NOT INITIAL.
    *selecting vendor name
        SELECT lifnr name1
            FROM lfa1
            INTO CORRESPONDING FIELDS OF  TABLE  it_name1
            FOR ALL ENTRIES IN it_lifnr
            WHERE lifnr EQ it_lifnr-lifnr.
      ENDIF.
      LOOP AT it_final.
        idx = sy-tabix.
    *retrieving purchase doc
        READ TABLE it_ebeln WITH KEY belnr = it_final-belnr
                                     gjahr = it_final-gjahr
                                     hkont = it_final-hkont.
        IF sy-subrc EQ 0.
          READ TABLE it_final INDEX idx.
          it_final-ebeln = it_ebeln-ebeln.
          MODIFY it_final INDEX sy-tabix.
        ENDIF.
    *retrieving WBS element
        READ TABLE it_po WITH KEY ebeln = it_final-ebeln.
        IF sy-subrc EQ 0.
          READ TABLE it_final INDEX idx.
          it_final-ps_psp_pnr = it_po-ps_psp_pnr.
          MODIFY it_final INDEX sy-tabix.
        ENDIF.
    calculating amount based on debit/credit
        IF it_final-shkzg = 'H'.
          it_final-dmbtr = 0 - it_final-dmbtr.
          it_final-wrbtr = 0 - it_final-wrbtr.
        ENDIF.
        MODIFY it_final INDEX idx.
      ENDLOOP.
      CLEAR idx.
      SORT it_final BY belnr ebeln DESCENDING.
    *updating blank purchase doc numbers
      CLEAR: temp_belnr, temp_ebeln,temp_gjahr.
      DATA: w_idx LIKE sy-tabix.
      LOOP AT it_final.
        w_idx = sy-tabix.
    *updating blank purchase docs
        IF it_final-gjahr = temp_gjahr AND it_final-belnr = temp_belnr.
          IF it_final-ebeln = ' '.
            it_final-ebeln = temp_ebeln.
          ENDIF.
        ENDIF.
        IF it_final-ebeln NE ' ' .
          CLEAR: temp_belnr, temp_ebeln, temp_gjahr.
          temp_belnr = it_final-belnr.
          temp_ebeln = it_final-ebeln.
          temp_gjahr = it_final-gjahr.
        ELSE.
          CLEAR : temp_belnr, temp_ebeln, temp_gjahr.
        ENDIF.
        MODIFY it_final TRANSPORTING ebeln.
    *retrieving vendor
        READ TABLE it_lifnr WITH KEY ebeln = it_final-ebeln.
        IF sy-subrc EQ 0.
          READ TABLE it_final INDEX w_idx.
          it_final-lifnr = it_lifnr-lifnr.
          MODIFY it_final INDEX sy-tabix.
        ENDIF.
    *retrieving GRIR number
        READ TABLE it_awkey WITH KEY belnr = it_final-belnr
                                     gjahr = it_final-gjahr
                                     bukrs = it_final-bukrs.
        IF sy-subrc EQ 0.
          READ TABLE it_final INDEX w_idx.
          it_final-awkey = it_awkey-awkey.
          MODIFY it_final INDEX sy-tabix.
        ENDIF.
    *retrieving vendor name
        READ TABLE it_name1 WITH KEY lifnr = it_final-lifnr.
        IF sy-subrc EQ 0.
          READ TABLE it_final INDEX w_idx.
          it_final-name1 = it_name1-name1..
          MODIFY it_final INDEX sy-tabix.
        ENDIF.
      ENDLOOP.
    *deleting entries which are not per input parameters
      DELETE it_final WHERE hkont NOT IN s_hkont.
      IF p_lifnr NE ' '.
        DELETE it_final WHERE lifnr NE p_lifnr.
      ENDIF.
    for selecting the grir number which is the first 10 digits of reference key and
    selecting vendor name
      LOOP AT it_final.
        MOVE it_final-awkey+0(10) TO it_final-grir.
        MODIFY it_final INDEX sy-tabix.
      ENDLOOP.
      SORT it_final BY hkont belnr.
    deleting entries where purchase doc is blank.
      DELETE it_final WHERE ebeln EQ ' '.
    ENDFORM.                    " select_data
    *&      Form  build_fieldcat
          text
    -->  p1        text
    <--  p2        text
    FORM e01_fieldcat_init  USING gt_fieldcat TYPE slis_t_fieldcat_alv.
      DATA: ls_fieldcat TYPE slis_fieldcat_alv.
      DATA: gs_sort TYPE slis_sortinfo_alv.
      CLEAR ls_fieldcat.
      ls_fieldcat-fieldname    = 'HKONT'.
      ls_fieldcat-tabname    = 'IT_FINAL'.
      ls_fieldcat-col_pos      = '1'.
      ls_fieldcat-seltext_l    = 'ACCOUNT'.
      APPEND ls_fieldcat TO gt_fieldcat.
      CLEAR ls_fieldcat.
      ls_fieldcat-fieldname    = 'BSCHL'.
      ls_fieldcat-tabname    = 'IT_FINAL'.
      ls_fieldcat-col_pos      = '2'.
      ls_fieldcat-seltext_l    = 'POSTING KEY'.
      APPEND ls_fieldcat TO gt_fieldcat.
      CLEAR ls_fieldcat.
      ls_fieldcat-fieldname    = 'BLART'.
      ls_fieldcat-tabname    = 'IT_FINAL'.
      ls_fieldcat-col_pos      = '3'.
      ls_fieldcat-seltext_l    = 'DOC TYPE'.
      APPEND ls_fieldcat TO gt_fieldcat.
      CLEAR ls_fieldcat.
      ls_fieldcat-fieldname    = 'BELNR'.
      ls_fieldcat-tabname    = 'IT_FINAL'.
      ls_fieldcat-col_pos      = '4'.
      ls_fieldcat-seltext_l    = 'DOC NUMBER'.
      ls_fieldcat-hotspot(1)   = 'X'.
      APPEND ls_fieldcat TO gt_fieldcat.
      CLEAR ls_fieldcat.
      ls_fieldcat-fieldname    = 'BUDAT'.
      ls_fieldcat-tabname    = 'IT_FINAL'.
      ls_fieldcat-col_pos      = '5'.
      ls_fieldcat-seltext_l    = 'POSTING DATE'.
      APPEND ls_fieldcat TO gt_fieldcat.
      CLEAR ls_fieldcat.
      ls_fieldcat-fieldname    = 'XBLNR'.
      ls_fieldcat-tabname    = 'IT_FINAL'.
      ls_fieldcat-col_pos      = '6'.
      ls_fieldcat-seltext_l    = 'REF. DOC NO'.
      APPEND ls_fieldcat TO gt_fieldcat.
      CLEAR ls_fieldcat.
      ls_fieldcat-fieldname    = 'EBELN'.
      ls_fieldcat-tabname    = 'IT_FINAL'.
      ls_fieldcat-col_pos      = '7'.
      ls_fieldcat-seltext_l    = 'PURCHASE DOC NO'.
      ls_fieldcat-hotspot(1)   = 'X'.
      APPEND ls_fieldcat TO gt_fieldcat.
      CLEAR ls_fieldcat.
      ls_fieldcat-fieldname    = 'GSBER'.
      ls_fieldcat-tabname    = 'IT_FINAL'.
      ls_fieldcat-col_pos      = '8'.
      ls_fieldcat-seltext_l    = 'BUSINESS AREA'.
      APPEND ls_fieldcat TO gt_fieldcat.
      CLEAR ls_fieldcat.
      ls_fieldcat-fieldname    = 'DMBTR'.
      ls_fieldcat-tabname    = 'IT_FINAL'.
      ls_fieldcat-col_pos      = '9'.
      ls_fieldcat-seltext_l    = 'AMOUNT(LC)'.
      APPEND ls_fieldcat TO gt_fieldcat.
      CLEAR ls_fieldcat.
      ls_fieldcat-fieldname    = 'WRBTR'.
      ls_fieldcat-tabname    = 'IT_FINAL'.
      ls_fieldcat-col_pos      = '10'.
      ls_fieldcat-seltext_l    = 'AMOUNT(DC)'.
      APPEND ls_fieldcat TO gt_fieldcat.
      CLEAR ls_fieldcat.
      ls_fieldcat-fieldname    = 'WAERS'.
      ls_fieldcat-tabname    = 'IT_FINAL'.
      ls_fieldcat-col_pos      = '11'.
      ls_fieldcat-seltext_l    = 'CURRENCY'.
      APPEND ls_fieldcat TO gt_fieldcat.
      CLEAR ls_fieldcat.
      ls_fieldcat-fieldname    = 'GJAHR'.
      ls_fieldcat-tabname    = 'IT_FINAL'.
      ls_fieldcat-col_pos      = '14'.
      ls_fieldcat-seltext_l    = 'Fiscal year'.
      APPEND ls_fieldcat TO gt_fieldcat.
      CLEAR ls_fieldcat.
      ls_fieldcat-fieldname    = 'GRIR'.
      ls_fieldcat-tabname    = 'IT_FINAL'.
      ls_fieldcat-col_pos      = '14'.
      ls_fieldcat-seltext_l    = 'GR/IR Number'.
      APPEND ls_fieldcat TO gt_fieldcat.
      CLEAR ls_fieldcat.
      ls_fieldcat-fieldname    = 'LIFNR'.
      ls_fieldcat-tabname    = 'IT_FINAL'.
      ls_fieldcat-col_pos      = '12'.
      ls_fieldcat-seltext_l    = 'VENDOR NO'.
      APPEND ls_fieldcat TO gt_fieldcat.
      CLEAR ls_fieldcat.
      ls_fieldcat-fieldname    = 'PS_PSP_PNR'.
      ls_fieldcat-tabname    = 'IT_FINAL'.
      ls_fieldcat-col_pos      = '13'.
      ls_fieldcat-seltext_l    = 'WBS Element'.
      APPEND ls_fieldcat TO gt_fieldcat.
      CLEAR ls_fieldcat.
      ls_fieldcat-fieldname    = 'NAME1'.
      ls_fieldcat-tabname    = 'IT_FINAL'.
      ls_fieldcat-col_pos      = '14'.
      ls_fieldcat-seltext_l    = 'VENDOR NAME'.
      APPEND ls_fieldcat TO gt_fieldcat.
    ENDFORM.                    " build_fieldcat
    *&      Form  LIST_DISPLAY
          text
    -->  p1        text
    <--  p2        text
    FORM list_display .
      gs_layout-colwidth_optimize(1)  = 'X'.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_background_id         = 'ALV_BACKGROUND'
          i_callback_program      = g_repid
          i_callback_user_command = 'USER_COMMAND'
          i_structure_name        = 'IT_FINAL'
          is_layout               = gs_layout
          it_fieldcat             = gt_fieldcat[]
          it_special_groups       = gt_sp_group[]
          it_sort                 = gt_sort[]
          it_filter               = gt_filter[]
          i_save                  = g_save
          is_variant              = g_variant
          it_events               = gt_events[]
          is_print                = gs_print
          it_alv_graphics         = gt_alv_graphics[]
          it_excluding            = gt_excluding
        TABLES
          t_outtab                = it_final.
    ENDFORM.                    " LIST_DISPLAY
    *&      Form  USER_COMMAND
    FORM user_command USING i_ucomm  LIKE sy-ucomm
                            is_selfield TYPE slis_selfield.     "#EC CALLED
      CASE i_ucomm.
        WHEN '&IC1'.                        " Pick(Double-click)
          CASE is_selfield-fieldname.
            WHEN 'BELNR'.
              CLEAR it_final.
              READ TABLE it_final INDEX is_selfield-tabindex.
              IF sy-subrc EQ 0.
              FI Document number
                SET PARAMETER ID 'BLN' FIELD it_final-belnr.
              Display Document
                CALL TRANSACTION 'FB03' AND SKIP FIRST SCREEN.
              ENDIF.
            WHEN 'EBELN'.
              CLEAR it_final.
              READ TABLE it_final INDEX is_selfield-tabindex.
              IF sy-subrc EQ 0.
              PO number
                IF it_final-ebeln NE ' '.
                  SET PARAMETER ID 'BES' FIELD it_final-ebeln.
              Display Document
                  CALL TRANSACTION 'ME23N' AND SKIP FIRST SCREEN.
                ENDIF.
              ENDIF.
          ENDCASE.
      ENDCASE.
    ENDFORM.                    "user_command
    *&      Form  display_data
          text
    -->  p1        text
    <--  p2        text
    FORM display_data .
      g_repid = sy-repid.
      PERFORM e01_fieldcat_init  USING gt_fieldcat[].
      PERFORM eventtab_build CHANGING gt_events.
      PERFORM e04_comment_build USING gt_list_top_of_page[].
    ENDFORM.                    " display_data
    *&      Form  eventtab_build
          text
         <--P_GT_EVENTS  text
    FORM eventtab_build CHANGING lt_events TYPE slis_t_event.
      CONSTANTS:
        gc_formname_top_of_page TYPE slis_formname VALUE 'TOP_OF_PAGE'.
      DATA: ls_event TYPE slis_alv_event.
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
        EXPORTING
          i_list_type = 0
        IMPORTING
          et_events   = lt_events.
      READ TABLE lt_events WITH KEY name = slis_ev_top_of_page
      INTO ls_event.
      IF sy-subrc = 0.
        MOVE gc_formname_top_of_page TO ls_event-form.
        APPEND ls_event TO lt_events.
      ENDIF.
    ENDFORM.                    " eventtab_build
    *&      Form  e04_comment_build
          text
         -->P_GT_LIST_TOP_OF_PAGE[]  text
    FORM e04_comment_build  USING e04_lt_top_of_page TYPE slis_t_listheader.
      DATA : v_time(10) TYPE c.
      DATA: ls_line TYPE slis_listheader.
      DATA : v_text(50) TYPE c.
      DATA : v_date_low(10)  TYPE c,
             v_date_high(10)  TYPE c.
      CONCATENATE 'GR/IR Report' ' '
      INTO v_text SEPARATED BY space.
      CLEAR ls_line.
      ls_line-typ  = 'H'.
      ls_line-info = v_text.
      APPEND ls_line TO e04_lt_top_of_page.
    ENDFORM.                    " e04_comment_build
    *&      Form  top_of_page
          text
    FORM top_of_page.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          it_list_commentary = gt_list_top_of_page.
    ENDFORM   .                    "TOP_OF_PAGE
    regards,
    Amit teja
    Message was edited by: amit teja
    Message was edited by: amit teja
    Message was edited by: amit teja

    Hello,
    <b>Sort it_final by belnr.</b>
    loop at it_final.
    on change of it_final-belnr.
    clear temp_gsber.
    clear temp_lifnr.
    <b>temp_belnr = it_final-belnr.</b>
    temp_gsber = it_final-gsber.
    temp_lifnr = it_final-lifnr.
    if it_final-gsber eq ' '.
    it_final-gsber = temp_gsber.
    endif.
    if it_final-lifnr eq ' '.
    it_final-lifnr = temp_lifnr.
    endif.
    modify it_final transporting gsber lifnr where <b>belnr = temp_belnr</b>.
    <b>endon.</b>
    endloop.
    Regards,
    Naimesh

  • Update Consumption posting field of MSEG table control

    Hi,
    We have free goods Sales order type(ZKFC) and reture(ZKFR). We post
    the free goods delivery update G/L is correct in FI document of MM
    movement(601). We post the return free goods delivery update G/L is
    incorrect in FI docuemt of MM movement(653). We checked the MSEG table
    found the Consumption posting field(MSEG-KZVBR) is empty for free goods
    delivery post. The Consumption posting field is 'V' for return free
    goods delivery post. The other order delivery post and return delivery
    post is OK.We want to know where configuration can control the
    Consumption posting field((MSEG-KZVBR)) update at MSEG table? Could you
    pls help us check it.Thanks.
    Movement type(601) FI docuemnt
    Dr: Sales Promo. Mat.
    Cr:F/G-Trading
    Movement type(653) FI docuemnt
    Dr: F/G-Trading
    Cr:Std.Cost-Trading
    We expected the 653 FI docuemtn
    Dr: F/G-Trading
    Cr:Sales Promo. Mat.
    Best Regards
    Park Han

    Hi,
    You can use tcode OMJJ to check for movement type 653, then look at the Account Grouping.
    There you should be able to identify the line that meets the posting, and since the Consumption is 'V', the Acct. modif should be VAY.
    Then to assign the correct G/L in tcode OBYC, look for combination of
    -event GBB
    -acct mod VAY
    -valuation class of the material
    But before you replace the G/L, confirm that the line is the correct one by matching the GL in MSEG and this line's GL.
    Thanks

  • ME51N update MPN Material field in the table control

    Hi Gurus,
    My requirement is to update the field MPN Material in the table control of tcode ME51N as soon as i enter the material this field should get updated.
    Please give me suggestions.
    Regards,
    Milind

    please see the link ...in this the   datefields also included in the table control  of the 
    Screen  program  ....  how the  fields are  populated in the table  using wizard ..
    <a href="http://">http://www.sapdevelopment.co.uk/dialog/tabcontrol/tc_basic.htm</a>
    reward points if it is usefull ....
    Girish

Maybe you are looking for

  • How do i save my web site to a cd

    How do i save my developing web site to a cd? and will all of the links still maintain their interety?

  • No Lightroom Templates in Print Module Template Browser

    I recently installed Lightroom 1.1 on a Windows XP Prof PC. Print/Template Browser/Lightroom Templates is empty, although other templates (e.g. Web) do appear when the appropriate module is selected. I looked for these templates on the Lighroom CD, b

  • ORA-01403 No Data Found Issue

    Hi, Im very new to streams and having a doubt regarding ORA-01403 issue happening while replication. Need you kind help on this regard. Thanks in advance. Oracle version : 10.0.3.0 1.Suppose there are 10 LCRs in a Txn and one of the LCR caused ORA-01

  • Xslt conversion not working: nosuchmethoderror:org.apache.xml.dtm.ref.sax2d

    hi all, iam trying to convert xml file to html using xslt. for that iam using xalan implementation 2.6. this was working fine when i checked it from the application, no iam using servet which instantiates a object of the class and calls the method...

  • Out of focus photos after burning dvd.

    I am using Magic iDVD in iDVD 08. Have created a movie with photos imported from iPhoto. All appears to be well when I preview the movie prior to burning it (i.e. photos are clear and sharp, and burning process appears to go as it should). But when I