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

Similar Messages

  • How to move field symbol internal table to internal table with header line?

    Dear all,
    hi...hereby i would like to ask how i can move field symbol internal table to a internal table?
    as i know field symbol internal table is without header line..
    so, may i know how to do this....to move field symbol internal table to internal table which consist of header line and field and record will same as field symbol internal table...in additional, my field symbol internal table is dynamic table mean everytime will have flexible columns..?
    Please advise...
    Thanks
    Regard,
    ToToRo.
    Edited by: @ToToRo@ on Aug 20, 2009 6:16 AM

    Hello,
    Try this way:
    If both the type of internal tables are same then you can directly assign dynamic internal table to static internal table.
    itab = <itab>.
    Suppose you have field symbol internal table <itab> which is different in structure from ITAB.
    Now, you can create <wa> as follow:
    FIELD-SYMBOLS <wa>.
    DATA wa TYPE REF TO DATA.
    CREATE DATA wa TYPE LINE OF <itab>.
    ASSIGN wa->* to <wa>.
    This way your work area is read.
    Using [ASSIGN COMPONENT|http://help.sap.com/saphelp_nw04/helpdata/EN/fc/eb3923358411d1829f0000e829fbfe/content.htm] syntax you can read required component of <wa>.
    Finally you can use that value to load static internal table.
    You can also refer to my thread on [Dynamic table|Re: Creating Dynamic table].
    Hope this helps!
    Thanks,
    Augustin.
    Edited by: Augustarian on Aug 20, 2009 10:06 AM

  • 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 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

  • 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...

  • Move fields from one table to another

    Hi,
    I would like to move fields from one internal table into corresponding fields of another internal table.
    move-corresponding syntax seems only to work with structures. How do you accomplish this for internal tables? Do I have to use for loops?
    regards
    Baran

    Yes you have to use loops and move-correspoding statements unless you have all the common fields in the same order on both internal table and no different fields to the left most.
    eg:
    data: begin of itab1 occurs 0,
             field1 type i,
          end of itab1.
    data: begin of itab2 occurs 0,
             field1 type i,
             field2(1),
          end of itab2.
    do 5 times.
    itab1-field1 = sy-index.
    append itab1.
    enddo.
    itab2[] = itab1[].
    loop at itab2.
    write:/ itab2-field1.
    endloop.
    The above code would give you some idea.
    Regards,
    ravi

  • Adding Amount field in BSEG table and display it single line item?

    hi experts,
           I am doing credit / debit form now my requirement is
                                               According to BELNR , GJAHR,BUKRS i want to find credit amount for this selection cretiria.
                         so i want to add all the lines of amount filed for a particular BELNR and display it as single line.
    so i am getting data from print program like this
    SELECTION-SCREEN BEGIN OF BLOCK b0 WITH FRAME TITLE text-001.
    SELECTION-SCREEN SKIP 2.
    PARAMETERS: p_belnr LIKE bkpf-belnr OBLIGATORY,
                p_bukrs LIKE bkpf-bukrs OBLIGATORY,
                p_gjahr LIKE bkpf-gjahr OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK b0.
    SELECT SINGLE *
                   FROM bkpf
                   INTO  i_bkpf
                   WHERE belnr = p_belnr
                         AND ( blart = 'DG' OR blart = 'ZG' )
                         AND bukrs = p_bukrs
                         AND gjahr = p_gjahr.
    IF sy-subrc = 0.
        SELECT  *
              FROM bseg
              INTO  table it_bseg
              WHERE belnr = i_bkpf-belnr .
      ENDIF.
      CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
        EXPORTING
          formname                 = 'Z_CREDIT_DEBIT'    " p_name
      VARIANT                  = ' '
      DIRECT_CALL              = ' '
        IMPORTING
          fm_name                  = v_form_name
    EXCEPTIONS
      NO_FORM                  = 1
      NO_FUNCTION_MODULE       = 2
      OTHERS                   = 3
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    CALL FUNCTION v_form_name
    EXPORTING
      ARCHIVE_INDEX              =
      ARCHIVE_INDEX_TAB          =
      ARCHIVE_PARAMETERS         =
      CONTROL_PARAMETERS         =
      MAIL_APPL_OBJ              =
      MAIL_RECIPIENT             =
      MAIL_SENDER                =
      OUTPUT_OPTIONS             =
      USER_SETTINGS              = 'X'
    IMPORTING
      DOCUMENT_OUTPUT_INFO       =
      JOB_OUTPUT_INFO            =
      JOB_OUTPUT_OPTIONS         =
      TABLES
        i_bkpf                     = i_bkpf
        i_bseg                     = i_bseg
    EXCEPTIONS
      FORMATTING_ERROR           = 1
      INTERNAL_ERROR             = 2
      SEND_ERROR                 = 3
      USER_CANCELED              = 4
      OTHERS                     = 5
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    so my I_BSEG containing all line items of particular BELNR . with the field SHKZG  iam  getting only credit line items .
      now i want to do is add all credited amount and display like this in a table.
    against ref#  (BSEG-REBZG) ! details (BSEG-SGTXT)!  amount
    124569                                   10%discount                950.00(total amount ie sum of all lines amount for a BELNR)
                                                                                    10.00(total tax amt ie sum of   all lines of tax amount for a BELNR)                                                                               
                                                                                    960.00

    hi arun,
             i used collect in smartform my procedure is like this .
                   i am getting data into i_BSEG because i declared like this in TABLES parameter
                      i created a loop .
                             in that i mentioned like I_BSEG into WA_BSEG.
                                   then i created a program lines here i mentioned like this.
                                                  COLLECT WA_BSEG INTO IT_BSEG.
               but because of BUZEI "Number of Line Item Within Accounting Document .it is not same it is varying for every credited time that means for every line of BELNR. thats why it is not adding it is just appending .
    so pls tell me any other chance to find sum .
    because i want to sum up all credted amount and display it in single line
    ie first column REBZG "Number of the Invoice the Transaction Belongs to(against ref) i want to display once .
    And Second column  SGTXT "item text(details) for amount once and for tax amount once
    And Third column Amount first line consists total amount & second line consists total for tax amount
    regards,
    satheesh.
    [email protected]
    any doubts chat me regarding this post.

  • 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

  • F110 - Grouping the vendor invoices by BSEG table fields

    Hi,
    I want to group the vendor invoices while making the payment through F110,  based on a BSEG table field. The settings in Grouping Key configuration (OBAP) only allows me to choose the fileds from BSIK table and not possible to select the fields from BSEG table.  Is there any other way to group the vendor invoices based on BSEG fileds?  How can we achieve this requirement in SAP?
    Thanks and Regards
    Koteswararao padarti

    Hi,
    I created the substitution and also grouping key based on the BSIK-KIDNO filed. But the system is not able to group the vendor invoices by payment reference.  I already tried the following options
    Seperate Payments for each Ref in FBZP settings
    Can anyone let me know what is missing in the configuration to group the invoices for payment by payment reference.
    Regards
    Koteswararao Padarti

  • Adding Custom Fields to BSEG and BKPF Tables

    Hi All,
    My customer would like to add around 5 fields to BKPF table and 6-7 fields to BSEG table. Can you all suggest me whether it would be a good idea to add any custom field to these tables ? I would like to mention that standard fields available in these tables will not be used for the requirements of the customer and he is insisting on adding custom fields. I need your expert advice on this matter.
    Regards,
    Rohit

    Hi Friend,
    Please do not add any custom fields in those tables.
    These two tables are pillar of accounting entries in SAP, if you want to push them then it is OK, otherwise find some other way.
    Regards
    Krishnendu

  • Error while activating the BSEG table

    hi guys ,
                today i joined SAP SCN . I have this error
    First i appended a structure of 5 fields in BSEG table .Then i tried to delete this append structure.
    But while deletiing it took nearly 20-25 minutes to process and timed out.So the structure is deleted
    from BSEG table but those 5 fields are still present in view V_QCMBSEG .Because of this BSEG table
    is now partially active .what should i do other than access key .

    Dear Deepak,
    welcome to SCN.
    How did you append structure in BSEG without access key, if you had appended you must have done it will access key as it is a standard table.
    secondly, the time out error is because BSEG is a cluster table, and the data volume in Bseg is very large as all the accounting document from various module is stored in this table, hence while deleting it system will check each line item wise before activating the table.
    Now the workaround is to check with your basis team to increase the memory index so that time out dump is eradicted and BSG becomes Active.
    Best practice: Don't append structure to standard table unless it is very crucial. if you are doing it for some report, kindly do a table join ( BSEG cannot be used as it is a cluster), you will get the same data in various secondary index table, by doing this the performance of the report will be better.
    Regards,
    M S Lokesh

  • BSEG Table update

    Hi All,
    My requirement is like that, Whenever I do the posting I want to update the BSEG Table field xref3.Please suggest is there any BTE exist for this.
    Points are surely awarded.
    Thanks
    Garg

    Hi All,
    I have found the following BTE to update the xref3 field of BSEG table with LIFNR.
    Even OPEN_FI_PERFORM_00001020_E...Even I have implement that BTE in my copy function module with the folowing code
    DATA : V_LIFNR LIKE BSEG-LIFNR.
      READ TABLE T_BSEG WITH KEY KOART = 'K'.
      IF SY-SUBRC = 0.
        V_LIFNR = T_BSEG-LIFNR.
        LOOP AT T_BSEG.
          T_BSEG-XREF3 = V_LIFNR.
          MODIFY T_BSEG.
        ENDLOOP.
      ENDIF.
    Whenever i simulate the posting
    But problem exist in the BTE OPEN_FI_PERFORM_00001020_E
    Becoz in this BTE code is like that in line, first the T_BSEG table entries get saved with the old entries in table  L_BSEG[]
      EXPORT T_BSEG T_BKPF TO MEMORY ID MEMID.
       L_BSEG[]  = T_BSEG[].
    After that the code written in my FM execute and update the BSEG value successfully..
    And the most confusing code thing again the T_BSEG  table get again updated with the old entries of L_BSEG[]* 
    T_BSEG[]  = L_BSEG[].
    So the table does n't get updated with the required entries.
    Your suggestion is valuable.Points are surely awarded
    Thanks
    Garg

  • Upadte bseg table

    hi all,
      hoe to add belnr field in bseg table whre bupla  ne to blr.
    plz help me
    sonu

    Hi,
         You should not update the BSEG table directly by yourself.
    BSEG usually deals with FI / Invoice documents, so when you create Invoices / Accounting documents this table will get updated.
    Use the bapi:BAPI_ACC_DOCUMENT_POST
    <b>Reward points</b>
    Regards

  • XREF3 field not getting populated in BSEG table while posting MIRO

    Hi,
         I have one query in MIRO tcode.I have activated xref3 field in MIRO tcode using enhancement LMR1MF6Q.Now when i try to post document with some values in xref3 field on screen ,value is not getting populated in BSEG table.Please tell me what else needs to be done to achieve this ?
    any hint on this?
    Thanks & Regards,
    Soniya S.

    Hi,
    1.- According to SAP Note 904652 - MIRO: Different from FB60
    https://service.sap.com/sap/support/notes/904652
    MIRO is an independent Materials Management (MM) transaction that does not
    claim to be the same as the accounting transactions (such as FB60 or FB01).
    MIRO was developed to allow users to process vendor invoices within the
    context of the MM procurement processes as simply as possible.
    For this reason, among other differences, the field selection was limited
    to the absolutely necessary. For example, the following fields from the
    accounting document are not available in Transaction MIRO (this list is not
    complete):
    Reference key (BSEG-XREF1, -XREF 2, -XREF 3)
    2.- SAP Note 1156325 - BAdIs in the Logistics Invoice Verification environment
    https://service.sap.com/sap/support/notes/1156325
    Have a look at badi MRM_ITEM_CUSTFIELDS.
    This badi will create a new tab at item level in order to display the new fields.
    I haven´t used this badi so i cannot talk from experience here.
    Think twice before deciding.
    Best regards.

  • Move Field symbol data to Internal table

    Dear All,
                     Please suggest how to move field symbol data to internal table. The requirement is I have dynamic data in Field symbol which to move to table parameter of a function module.
    Thanks in Advance
    Rams.

    Dear All,
                    In need to pass tabular data  i.e. multiple entries from field symbol to the table parameter of the custom function module.
    Field symbol is declared as below:
    FIELD-SYMBOLS: <FS_EXCEL_TAB> TYPE STANDARD TABLE,
                                 <FS_TABLE_HEADER> .
    DATA WA_PD LIKE PRICE_DOWNLOAD.
    APPEND <FS_TABLE_HEADER> TO <FS_EXCEL_TAB>.
    CLEAR <FS_TABLE_HEADER>.
      WA_PD-VKORG = <FS_EXCEL_TAB>-VKORG.u201D Problem while using this statement
      APPEND WA_PD TO PRICE_DOWNLOAD.
       CLEAR WA_PD.
    Field symbol <FS_EXCEL_TAB>  is populated like this.
    VKORG | KUNNR_SH | KUNNR_SP |
    0015      | 102105       | 102105       |
    Now I need to move this data to table in tables parameter of custom fucntion module.
    Thanks in advance,
    Rams

Maybe you are looking for

  • I need professional data recovery help

    Can anybody point me in a good direction for people who can help with Mac-related data recovery? (I've been trying AppleCare all day and they've been no help at all)

  • Passing data to mod_osso authentication for IPASAuthInterface

    Hi all, I've been a little frustrated recently attempting to create a plugin using mod_osso with Oracle Identity Management suite which automates the login of users on our system. What we would like to do is implement an interface for IPASAuthInterfa

  • ISE Captive Portal & redundancy

    I have a guest SSID configured in my WLC. I also have 2 ISE appliances (Primary/Secondary) that I use to do the web auth on my guest SSID. In the config of my SSID (Security / Layer 3 / Web Policy), I selected "Web Auth Type: External" and I had to e

  • Need so somehow come back from reading a port to do other things.

    I got a class that runs a GUI to open a user's webcam and display the view. Then the class goes over to another class that reads from a serial port to display the speed frmo a GPS receiver on the port and display it on the GUI. Then I need the GUI to

  • Latest Database patch set

    I have Win 2k3 standard server and oracle9i Rel2 i need to install patchset asap on my server Is the patchset 9.2.0.5 the lates? or there a 9.2.0.6???? Thanks in Advance Regards Tony G.