BSEG Logic

Hi Guyz,
i'm looking for following logic for Accounts Payable transactions ...i'm developing a report having 'document type' and posting date on selection screen.....
i'm downloading the results in CSV file... i want to know how to identify a bseg line item whether it is a gross amount or net amount... as my program does processing based on this ....
DMBTR will have the value for each line item (gross, net, tax) .... i'm looking for logic which should work for all AP document types (i.e., doc types in FB01) ....
i'm sure program needs to workout logic based on posting keys and may be doc types also... any help??
thanks in advance

The essential first step when building a report is to understand your data.  FI documents are configured differently at different sites, so follow the good advice already given and ask your FI consultant about this.  To get some more technical information, display a document in FB03 while running ST05 SQL trace - the trace file should tell you all you need to know about how to get the data from the database.

Similar Messages

  • Unable to retrieve nametab info for logic table BSEG during Database Export

    Hi,
    Our aim is to Migrate to New hardware and do the Database Export of the existing System(Unicode) and Import the same in the new Hardware
    I am doing Database Export on SAP 4.7 SR1,HP-UX ,Oracle 9i(Unicode System) and during Database Export "Post Load Processing phase" got the error as mentioned in SAPCLUST.log
    more SAPCLUST.log
    /sapmnt/BIA/exe/R3load: START OF LOG: 20090216174944
    /sapmnt/BIA/exe/R3load: sccsid @(#) $Id: //bas/640_REL/src/R3ld/R3load/R3ldmain.c#20
    $ SAP
    /sapmnt/BIA/exe/R3load: version R6.40/V1.4 [UNICODE]
    Compiled Aug 13 2007 16:20:31
    /sapmnt/BIA/exe/R3load -ctf E /nas/biaexp2/DATA/SAPCLUST.STR /nas/biaexp2/DB/DDLORA.T
    PL /SAPinst_DIR/SAPCLUST.TSK ORA -l /SAPinst_DIR/SAPCLUST.log
    /sapmnt/BIA/exe/R3load: job completed
    /sapmnt/BIA/exe/R3load: END OF LOG: 20090216174944
    /sapmnt/BIA/exe/R3load: START OF LOG: 20090216182102
    /sapmnt/BIA/exe/R3load: sccsid @(#) $Id: //bas/640_REL/src/R3ld/R3load/R3ldmain.c#20
    $ SAP
    /sapmnt/BIA/exe/R3load: version R6.40/V1.4 [UNICODE]
    Compiled Aug 13 2007 16:20:31
    /sapmnt/BIA/exe/R3load -datacodepage 1100 -e /SAPinst_DIR/SAPCLUST.cmd -l /SAPinst_DI
    R/SAPCLUST.log -stop_on_error
    (DB) INFO: connected to DB
    (DB) INFO: DbSlControl(DBSL_CMD_NLS_CHARACTERSET_GET): UTF8
    (GSI) INFO: dbname   = "BIA20071101021156                                                                               
    (GSI) INFO: vname    = "ORACLE                          "
    (GSI) INFO: hostname = "tinsp041                                                    
    (GSI) INFO: sysname  = "HP-UX"
    (GSI) INFO: nodename = "tinsp041"
    (GSI) INFO: release  = "B.11.11"
    (GSI) INFO: version  = "U"
    (GSI) INFO: machine  = "9000/800"
    (GSI) INFO: instno   = "0020293063"
    (EXP) TABLE: "AABLG"
    (EXP) TABLE: "CDCLS"
    (EXP) TABLE: "CLU4"
    (EXP) TABLE: "CLUTAB"
    (EXP) TABLE: "CVEP1"
    (EXP) TABLE: "CVEP2"
    (EXP) TABLE: "CVER1"
    (EXP) TABLE: "CVER2"
    (EXP) TABLE: "CVER3"
    (EXP) TABLE: "CVER4"
    (EXP) TABLE: "CVER5"
    (EXP) TABLE: "DOKCL"
    (EXP) TABLE: "DSYO1"
    (EXP) TABLE: "DSYO2"
    (EXP) TABLE: "DSYO3"
    (EXP) TABLE: "EDI30C"
    (EXP) TABLE: "EDI40"
    (EXP) TABLE: "EDIDOC"
    (EXP) TABLE: "EPIDXB"
    (EXP) TABLE: "EPIDXC"
    (EXP) TABLE: "GLS2CLUS"
    (EXP) TABLE: "IMPREDOC"
    (EXP) TABLE: "KOCLU"
    (EXP) TABLE: "PCDCLS"
    (EXP) TABLE: "REGUC"
    myCluster (55.16.Exp): 1557: inconsistent field count detected.
    myCluster (55.16.Exp): 1558: nametab says field count (TDESCR) is 305.
    myCluster (55.16.Exp): 1561: alternate nametab says field count (TDESCR) is 304.
    myCluster (55.16.Exp): 1250: unable to retrieve nametab info for logic table BSEG   
    myCluster (55.16.Exp): 8033: unable to retrieve nametab info for logic table BSEG   
    myCluster (55.16.Exp): 2624: failed to convert cluster data of cluster item.
    myCluster: RFBLG      *003**IN07**0001100000**2007*
    myCluster (55.16.Exp): 318: error during conversion of cluster item.
    myCluster (55.16.Exp): 319: affected physical table is RFBLG.
    (CNV) ERROR: data conversion failed.  rc = 2
    (RSCP) WARN: env I18N_NAMETAB_TIMESTAMPS = IGNORE
    (DB) INFO: disconnected from DB
    /sapmnt/BIA/exe/R3load: job finished with 1 error(s)
    /sapmnt/BIA/exe/R3load: END OF LOG: 20090216182145
    /sapmnt/BIA/exe/R3load: START OF LOG: 20090217115935
    /sapmnt/BIA/exe/R3load: sccsid @(#) $Id: //bas/640_REL/src/R3ld/R3load/R3ldmain.c#20
    $ SAP
    /sapmnt/BIA/exe/R3load: version R6.40/V1.4 [UNICODE]
    Compiled Aug 13 2007 16:20:31
    /sapmnt/BIA/exe/R3load -datacodepage 1100 -e /SAPinst_DIR/SAPCLUST.cmd -l /SAPinst_DI
    R/SAPCLUST.log -stop_on_error
    (DB) INFO: connected to DB
    (DB) INFO: DbSlControl(DBSL_CMD_NLS_CHARACTERSET_GET): UTF8
    (GSI) INFO: dbname   = "BIA20071101021156                                                                               
    (GSI) INFO: vname    = "ORACLE                          "
    (GSI) INFO: hostname = "tinsp041                                                    
    (GSI) INFO: sysname  = "HP-UX"
    (GSI) INFO: nodename = "tinsp041"
    (GSI) INFO: release  = "B.11.11"
    (GSI) INFO: version  = "U"
    (GSI) INFO: machine  = "9000/800"
    (GSI) INFO: instno   = "0020293063"
    myCluster (55.16.Exp): 1557: inconsistent field count detected.
    myCluster (55.16.Exp): 1558: nametab says field count (TDESCR) is 305.
    myCluster (55.16.Exp): 1561: alternate nametab says field count (TDESCR) is 304.
    myCluster (55.16.Exp): 1250: unable to retrieve nametab info for logic table BSEG   
    myCluster (55.16.Exp): 8033: unable to retrieve nametab info for logic table BSEG   
    myCluster (55.16.Exp): 2624: failed to convert cluster data of cluster item.
    myCluster: RFBLG      *003**IN07**0001100000**2007*
    myCluster (55.16.Exp): 318: error during conversion of cluster item.
    myCluster (55.16.Exp): 319: affected physical table is RFBLG.
    (CNV) ERROR: data conversion failed.  rc = 2
    (RSCP) WARN: env I18N_NAMETAB_TIMESTAMPS = IGNORE
    (DB) INFO: disconnected from DB
    SAPCLUST.l/sapmnt/BIA/exe/R3load: job finished with 1 error(s)
    /sapmnt/BIA/exe/R3load: END OF LOG: 20090217115937
    og (97%)
    The main eror is "unable to retrieve nametab info for logic table BSEG "  
    Your reply to this issue is highly appreciated
    Thanks
    Sunil

    Hello,
    acording to this output:
    /sapmnt/BIA/exe/R3load -datacodepage 1100 -e /SAPinst_DIR/SAPCLUST.cmd -l /SAPinst_DI
    R/SAPCLUST.log -stop_on_error
    you are doing the export with a non-unicode SAP codepage. The codepage has to be 4102/4103 (see note #552464 for details). There is a screen in the sapinst dialogues that allows the change of the codepage. 1100 is the default in some sapinst versions.
    Best Regards,
    Michael

  • Create a Logical Database Based on Mseg and Bseg

    Hi,
      how can i create a Logical database using bkpf,bseg,mkpf,mseg. i need to know , which table is a root node ?
    could any one help me?
       Thanks

    Hi Amit,
           While I am Creating the Logical Database by selection MKPF as root node, i have one problem.
       my selection-screen is,
        Plant  Bseg-werks,
        G/Laccount Bseg-Hkont,
        Fin year bseg-gjahr,
        Grn Date Bkpf-Budat,
        Vendor No Bseg-lifnr,
        Po        Bseg-ebeln,
        MatNr     Bseg-matnr.
      My LDB structure is
             MKPF
    Mseg
    BKPF
    Bseg.
      My Doubt is, how can I access the glaccount details from bseg and How can i fetch the data from Mseg and Mkpf
    (Grn details) .
      If you give the Source code it is very useful to me.
      Thanks,
      Neptune.M

  • Unicode Export - unable to retrieve nametab info for logic table BSEG

    Hi
    We are performing a unicode export (CUUC from 4.6C upgrade to ECC 6.0) and we have incurred this error.
            Without ORDER BY PRIMARY KEY the exported data may be unusable for some databases
    Our OS is HPUX11.31 & Database is 10.2.0.2
    myCluster (63.21.Exp): 1610: inconsistent settings for table position validity detected.
    myCluster (63.21.Exp): 1611: nametab says table positions are valid.
    myCluster (63.21.Exp): 1614: alternate nametab says table positions are not valid.
    myCluster (63.21.Exp): 1617: for field 310 of nametab displacement is 1877, yet dbtabpos shows 1885.
    myCluster (63.21.Exp): 1621: character length is 1 (in) resp. 2 (out).
    myCluster (63.21.Exp): 1257: unable to retrieve nametab info for logic table BSEG      .
    myCluster (63.21.Exp): 8358: unable to acquire nametab info for logic table BSEG      .
    myCluster (63.21.Exp): 2949: failed to convert cluster data of cluster item.
    myCluster: RFBLG      *400**AT10**0000100000**2004*
    myCluster (63.21.Exp): 322: error during conversion of cluster item.
    myCluster (63.21.Exp): 323: affected physical table is RFBLG.
    (CNV) ERROR: data conversion failed.  rc = 2
    (DB) INFO: disconnected from DB
    /usr/sap/SBX/SYS/exe/run/R3load: job finished with 1 error(s)
    /usr/sap/SBX/SYS/exe/run/R3load: END OF LOG: 20081102104452
    We checked the note 913783 as per the CUUC guide but the correction only for package SAPKB70004 to 6. but we are in package SAPKB70011.
    We had found two notes:
    1. Note 1238351 - Hom./Het.System Copy SAP NW 7.0 incl. Enhancement Package 1
    :Solution:
    There are two possible workarounds:
    1. Modify DDL<dbs>.TPL (<dbs> = ADA, DB2, DB4, DB6, IND, MSS, ORA) BEFORE the R3load TSK files are generated;
                  search for the keyword "negdat:" and add "CLU4" and "VER_CLUSTR" to thisline.
    2. Modify the TSK file (most probably SAPCLUST.TSK) BEFORE R3load import is(re-)started.
                  search for the lines starting with "D CLU4 I" and "D VER_CLUSTR I" and change the status (i.e. "err" or "xeq") to "ign" or remove the lines. "
    I tried the above solution by editing the file DDL*.TPL but it is skipping the table and marks it as completed but its not the good solution as we will be miss the data from the table RFBLG.
    2. Note 991401 - SYSCOPY EXPORT FAILS:SAPCLUST:ERROR: Code page conversion:
    Solution
    Activate the table.
    Then call the RADCUCNT report. Do not change the selected parameters, but ensure that 'Overwrite Entries' is selected.  Set the 'Unicode Length' to 2 and fill the last two fields 'Type' and 'Name' with TABL and TACOPAB respectively. Then select 'No Log' or specify a log name.
    Execute the RADCUCNT report and restart the export.
    We have not tried this solution, bcos SAP is still down and CDCLS job is still running.
    We would like to know whether you have faced any issues like the above one and what is your suggested approach and solution.
    Is it safe to start SAP now (when the CDCLS job runs) and then try to activate the table RFBLG?
    Regards
    Senthil
    Edited by: J. Senthil Murugan on Nov 3, 2008 1:41 AM
    Edited by: J. Senthil Murugan on Nov 3, 2008 3:36 AM

    Hi Senthil,
    If you have done your pre-conversion steps before upgrade and after upgrade successfully then you should not see the below errors. However changes to SPDD tables may some times also have some impact during conversion and throws nametab errors occurs. Program RADCUCNT runs in the end of upgrade to update nametab tables if any new changes happned during upgrade.
    You can do any no of exports to complete  jobs successfully.yeah When export running you shouldnt bring SAP up.
    The tables you have mentioned all are cluster tables and CDCLS being the biggest table it will take hrs to complete depending on your size of the database.
    Do not pay around with the .TSK file until if you are sure you want to re-execute it.Your first possiblility is skipped because there may be multiple same .TSK files present locally(where u r running distribution.monitor (or) sapinst ) and on the common directory. You may also look at the .TSK.bkp files because it get information and creates a new .TSK. This is not complicated but tricky.
    secound possibility is to update the changed tables(eg: RFBLG...)  to conversion tables.Follow the Note but make sure no R3load processes are running before you start SAP. If you dont want to wait long and sure to restart other processes which are running you can kill it and start SAP. Specify your error tables only and follow instructions given in the note.Once done bring down  SAP app. and restart the export process using ur sapinst or distribution monitor.
    Regards,
    Vamshi.

  • Unable to retrieve nametab info for logic table BSEG

    Hi
    We are performing a unicode export (CUUC from 4.6C upgrade to ECC 6.0) and we have incurred this error.
    Without ORDER BY PRIMARY KEY the exported data may be unusable for some databases
    Our OS is HPUX11.31 & Database is 10.2.0.2
    myCluster (63.21.Exp): 1610: inconsistent settings for table position validity detected.
    myCluster (63.21.Exp): 1611: nametab says table positions are valid.
    myCluster (63.21.Exp): 1614: alternate nametab says table positions are not valid.
    myCluster (63.21.Exp): 1617: for field 310 of nametab displacement is 1877, yet dbtabpos shows 1885.
    myCluster (63.21.Exp): 1621: character length is 1 (in) resp. 2 (out).
    myCluster (63.21.Exp): 1257: unable to retrieve nametab info for logic table BSEG .
    myCluster (63.21.Exp): 8358: unable to acquire nametab info for logic table BSEG .
    myCluster (63.21.Exp): 2949: failed to convert cluster data of cluster item.
    myCluster: RFBLG *400**AT10**0000100000**2004*
    myCluster (63.21.Exp): 322: error during conversion of cluster item.
    myCluster (63.21.Exp): 323: affected physical table is RFBLG.
    (CNV) ERROR: data conversion failed. rc = 2
    (DB) INFO: disconnected from DB
    /usr/sap/SBX/SYS/exe/run/R3load: job finished with 1 error(s)
    /usr/sap/SBX/SYS/exe/run/R3load: END OF LOG: 20081102104452
    We checked the note 913783 as per the CUUC guide but the correction only for package SAPKB70004 to 6. but we are in package SAPKB70011.
    We had found two notes:
    1. Note 1238351 - Hom./Het.System Copy SAP NW 7.0 incl. Enhancement Package 1
    :Solution:
    There are two possible workarounds:
    1. Modify DDL<dbs>.TPL (<dbs> = ADA, DB2, DB4, DB6, IND, MSS, ORA) BEFORE the R3load TSK files are generated;
                  search for the keyword "negdat:" and add "CLU4" and "VER_CLUSTR" to thisline.
    2. Modify the TSK file (most probably SAPCLUST.TSK) BEFORE R3load import is(re-)started.
                  search for the lines starting with "D CLU4 I" and "D VER_CLUSTR I" and change the status (i.e. "err" or "xeq") to "ign" or remove the lines. "
    I tried the above solution by editing the file DDL*.TPL but it is skipping the table and marks it as completed but its not the good solution as we will be miss the data from the table RFBLG.
    2. Note 991401 - SYSCOPY EXPORT FAILS:SAPCLUST:ERROR: Code page conversion:
    Solution
    Activate the table.
    Then call the RADCUCNT report. Do not change the selected parameters, but ensure that 'Overwrite Entries' is selected.  Set the 'Unicode Length' to 2 and fill the last two fields 'Type' and 'Name' with TABL and TACOPAB respectively. Then select 'No Log' or specify a log name.
    Execute the RADCUCNT report and restart the export.
    We have not tried this solution, bcos SAP is still down and CDCLS job is still running.
    We would like to know whether you have faced any issues like the above one and what is your suggested approach and solution.
    Is it safe to start SAP now (when the CDCLS job runs) and then try to activate the table RFBLG?
    Regards
    Senthil
    Edited by: J. Senthil Murugan on Nov 3, 2008 1:40 AM
    Edited by: J. Senthil Murugan on Nov 3, 2008 3:37 AM

    Dear Senthil
    I had faced this issue earlier.
    Table BSEG Requires activity in the ACT phase, like activation etc.
    If we do the ACT phase using the transports and not perform manual activation of this table, this issue arrives.
    Please share the relevant information--- seems some steps are missed out or not carried properly in the CU&UC phase.
    Otherways, we had applied the solution  Note 991401 - SYSCOPY EXPORT FAILS:SAPCLUST:ERROR: Code page conversion and it worked well..
    But you need to be sure, that this table was changed(activated etc) during the Upgrade till export phase.
    Issue is Nametab info is created during the Upgrade phase in CU&UC and if this table is touched, that nametab info is not getting it right as the runtime object is changed.
    With RADCUCNT the nametab info will be created again.
    All the Best
    Best Regards
    Deepak Dhawan

  • Link GLPCA Ref doc to BSEG (ABAP Table Logic)

    Hi, We are trying to link GLPCA to BSEG via the Reference Doc No in GLPCA.  This is to get the reference field in BSEG. 
    All seems to work well for finance documents, but when we work with GLPCA Sales Doc Types RV the REFDOC Line has the line of the sales doc and not the BSEG Finance Doc.  (our Sales Doc # is the same as the invoice).  So now the only way we can think of to link GLPCA to BSEG is to go to BSEG by Ref Doc No. and loop through all of the BSEG entries for the document and compare the value to get the correct BSEG line.
    Can anyone think of a better way to get the BSEG Line from GLPCA when working with Sales Docs?
    Thanks for any help or comments..

    HI
    1 )  Billing Document Number (VBRK u2013 VBELN)
    2 ) Accounting document Number (BKPF u2013 BELNR)
    VBRK u2013 VBELN AND BKPF u2013 XBLNR BOTH ARE SAME
    Rgds
    SumaMani

  • LOGICAL DATABASE BRF   FOR ...  BKPF AND BSEG

    Hi friends  ,
    i want the change the input criteria  ( select option) in my program , i am using the LDB  "BRF"  ..it gives me standard selection screen  .. but i want to add the GSBER   field in the input  condition  ..
    How can i cahge the selection  criteria in standard LDB ..How can i do that ..
    Ialso want to convert select option in  output to  parameter ...
    Plz suggest..

    Dude LDB gives me one extra selection  parameter   but i need not that parameter ...
    Is ther any way by which i remove that  selection parameter and add up my new paramere ...
    The same thing  i done in pnp LDB  but i am unable to do  same in brf LDB. 
    Beaus in PNP there is "HR report  category "  BY which i cam made  >>>>

  • Dynamic Logical Expressions in ABAP: IF (lt_cond)...

    is it possible to have a dynamically constructured logical expression?
    I have a condition I need to use in an IF, but I want to avoid hard-coding, so I dynamicallybuild it.
    for a simple example:
    CONCATENATE ITAB-f1
               'EQ'
               varValue
               INTO lt_cond SEPARATED BY SPACE.
    IF (lt_cond).
      WRITE:/ 'Success'.
    ENDIF.
    Is it possible to do this?
    NL

    I am trying to use the macro to check an IF (cond).
    cond is a dynamically constructed condition.
    The bold part of my code way below is my problem area.
    I'm having no trouble getting COND constructed. But I am having trouble between my macro and the processing as my error always tells me I'm calling my macro without 2 actual parameters. Or when I DEFINE my macro with &1 instead of &1 &2, I get 'incorrect logical expression'.
    I've read all the documentation I can find on this, but i still cannot figure out why my macro is not processing.
    Code is lengthy, but if you can, please help.
    I'm anticipating the output to be 'FAILURE' at this point. I just want the condition COND to be processed.
    data: tabfield(20) type c,
          orcheck type I,
          cond type string.
    DATA: BEGIN OF ITAB_NOTIDX OCCURS 0,
          FIELD LIKE ZDOLTARC02-SEARCHFLD,
          VALUE LIKE ZDOLTARC03-VALUE,
          STRUCTURE LIKE ZDOLTARC02-STRUCTURE,
          AOBJ LIKE ZDOLTARC02-A_OBJ,
          END OF ITAB_NOTIDX.
    DATA: BEGIN OF ITAB_AOBJ OCCURS 0,
          AOBJ LIKE ZDOLTARC02-A_OBJ,
          END OF ITAB_AOBJ.
    DATA: ITAB_AOBJF LIKE ITAB_AOBJ.
    DATA: ITAB_NOTIDXF LIKE ITAB_NOTIDX.
    DATA: varAOBJ LIKE ZDOLTARC02-A_OBJ.
    ITAB_NOTIDXF-FIELD = 'LIFNR'.
    ITAB_NOTIDXF-VALUE = '123'.
    ITAB_NOTIDXF-STRUCTURE = 'BKPF'.
    ITAB_NOTIDXF-AOBJ = 'FI_DOCUMNT'.
    APPEND ITAB_NOTIDXF TO ITAB_NOTIDX.
    ITAB_NOTIDXF-FIELD = 'LIFNR'.
    ITAB_NOTIDXF-VALUE = 'ABC'.
    ITAB_NOTIDXF-STRUCTURE = 'BKPF'.
    ITAB_NOTIDXF-AOBJ = 'FI_DOCUMNT'.
    APPEND ITAB_NOTIDXF TO ITAB_NOTIDX.
    ITAB_NOTIDXF-FIELD = 'LIFNR'.
    ITAB_NOTIDXF-VALUE = '001'.
    ITAB_NOTIDXF-STRUCTURE = 'BKPF'.
    ITAB_NOTIDXF-AOBJ = 'FI_DOCUMNT'.
    APPEND ITAB_NOTIDXF TO ITAB_NOTIDX.
    ITAB_NOTIDXF-FIELD = 'SAKNR'.
    ITAB_NOTIDXF-VALUE = '111'.
    ITAB_NOTIDXF-STRUCTURE = 'BSEG'.
    ITAB_NOTIDXF-AOBJ = 'FI_DOCUMNT'.
    APPEND ITAB_NOTIDXF TO ITAB_NOTIDX.
    ITAB_NOTIDXF-FIELD = 'SAKNR'.
    ITAB_NOTIDXF-VALUE = '222'.
    ITAB_NOTIDXF-STRUCTURE = 'BSEG'.
    ITAB_NOTIDXF-AOBJ = 'FI_DOCUMNT'.
    APPEND ITAB_NOTIDXF TO ITAB_NOTIDX.
    ITAB_NOTIDXF-FIELD = 'KUNNR'.
    ITAB_NOTIDXF-VALUE = 'CCC'.
    ITAB_NOTIDXF-STRUCTURE = 'BSEG'.
    ITAB_NOTIDXF-AOBJ = 'FI_DOCUMNT'.
    APPEND ITAB_NOTIDXF TO ITAB_NOTIDX.
    ITAB_NOTIDXF-FIELD = 'KUNNR'.
    ITAB_NOTIDXF-VALUE = 'DDD'.
    ITAB_NOTIDXF-STRUCTURE = 'BSEG'.
    ITAB_NOTIDXF-AOBJ = 'FI_DOCUMNT'.
    APPEND ITAB_NOTIDXF TO ITAB_NOTIDX.
    LOOP AT ITAB_NOTIDX.
      WRITE:/ ITAB_NOTIDX-FIELD, ITAB_NOTIDX-VALUE, ITAB_NOTIDX-STRUCTURE, ITAB_NOTIDX-AOBJ.
    ENDLOOP.
    DATA: VARFIELDNAME LIKE ZDOLTARC02-FIELD.
    CONCATENATE cond
               INTO Cond.
    SORT ITAB_NOTIDX BY AOBJ FIELD.
    varFieldName = Itab_NOTIDX-FIELD.
    ORCHECK = 0.
    ITAB_AOBJF = 'FI_DOCUMNT'.
    APPEND ITAB_AOBJF TO ITAB_AOBJ.
    LOOP AT ITAB_AOBJ.
       MOVE ITAB_AOBJ-AOBJ TO varAOBJ.
       WRITE:/ varAOBJ.
       LOOP AT ITAB_NOTIDX WHERE AOBJ EQ varAOBJ.
               WRITE:/ 'LOOP TEST'.
            IF ITAB_NOTIDX-FIELD EQ varFieldName.
                 WRITE:/ VARFIELDNAME.
                 IF ORCHECK <> 0.
                 CONCATENATE cond
                                'OR'
                                INTO cond SEPARATED BY SPACE.
                 ENDIF.
                 CONCATENATE ITAB_NOTIDX-STRUCTURE
                        ITAB_NOTIDX-FIELD
                        INTO tabfield.
                 CONCATENATE cond
                        tabfield
                        'EQ'
                        '''' ITAB_NOTIDX-value ''''
                        INTO cond SEPARATED BY SPACE.
                 ORCHECK = ORCHECK + 1.
            ELSE.
                MOVE ITAB_NOTIDX-FIELD TO varFieldName.
              WRITE:/ '2', VARFIELDNAME.
                CLEAR TABFIELD.
              ORCHECK = 0.
              CONCATENATE ITAB_NOTIDX-STRUCTURE
                    varFieldName
                    INTO TABFIELD.
                 CONCATENATE cond
                        'AND'
                        TABFIELD
                    'EQ'
                    '''' ITAB_NOTIDX-VALUE ''''
                        INTO cond SEPARATED BY SPACE.
                    ORCHECK = ORCHECK + 1.
            ENDIF.
       ENDLOOP.
    ENDLOOP.
    CONCATENATE COND
                INTO COND.
    write:/ COND. "constructed properly
    <b>DEFINE my_dynamic_check.
    if &1, &2.
      write:/ 'Success'.
    else.
      write:/ 'Failed'.
    endif.
    END-OF-DEFINITION.
    my_dynamic_check (cond).</b>

  • How to write code for this logic in a routine, very urgent --help me

    hi all,
    i want to apply this logic into one subroutin ZABC.
    here i m giving my logic ,can any body help me in coding for this, this is very urgent, i hv to submit on wednesday.
    4.1 Read the company code number BSEG-BUKRS from document line item.
    4.2 Fetch PRDHA from MARA into GV_PRDHA where MATNR = BSEG-MATNR.
    4.3 Fetch Business area (GSBER) from ZFIBU into GV_GSBER where (PRDHA = GV_PRDHA and BUKRS = BSEG-BUKRS) OR (PRDHA = GV_PRDHA and BUKRS = SPACE).
    4.4 If business area match is found, go to step 3.9. Else continue.
    4.5 If BKPF-BLART IN set “ZVS_POSDT” OR BKPF-XBLNR starts with “I0*”, execute steps below. Else, go to Step 3.6.
    i. MOVE: BSEG-BKURS TO work area field WA_ZFIBUE-BUKRS,
    BSEG-MATNR TO work area field WA_ZFIBUE-MATNR,
    GV_PRDHA TO work area field WA_ZFIBUE-PRDHA,
    BSEG-HKONT TO work area field WA_ZFIBUE-HKONT,
    BSEG-GSBER TO work area field WA_ZFIBUE-GSBER,
    BSEG-PSWBT TO work area field WA_ZFIBUE-PSWBT,
    BKPF-BUDAT TO work area field WA_ZFIBUE-BUDAT,
    SY-DATUM TO work area field WA_ZFIBUE-CREDATE,
    SY-UZEIT TO work area field WA_ZFIBUE-CRETIME,
    Fetch running serial number (WA_ZFIBUE-SERIALNO) from ZFICO. This number will be stored in ZFICO with PARAMTYPE = "BPM030307", SUBTYPE = "ZFIBUE" and KEY1 = "SERIALNO". The actual serial number will be stored in the field VALUE1.
    i. Insert WA_ZFIBUE INTO ZFIBUE.
    ii. Send email notification to the user (if it is not already sent to user on the same posting date).
    Use function module ‘SO_NEW_DOCUMENT_ATT_SEND_API1’ to send mail.
    Fetch email address and date of last email from ZFICO. These values will be stored in ZFICO with PARAMTYPE = "BPM030307", SUBTYPE = "EMAIL" and KEY1 = "<USERNAME>". The email address will be stored in the field VALUE1 and posting date in VALUE2. Once mail is sent, VALUE2 is updated with latest posting date (BKPF-BUDAT).
    iii. Increment the running serial number and update ZFICO with new serial number.
    a. GV_ SERIALNO = WA_ZFIBUE-SERIALNO + 1
    b. Update ZFICO Set value1 = GV_SERIALNO
    Where PARAMTYPE = "BPM030307" AND
    SUBTYPE = "ZFIBUE" AND
    KEY1 = "SERIALNO".
    iv Move “VDFT” to BSEG-GSBER.
    v. Exit routine.
    4.6 Fetch MTART into GV_MTART from MARA where MATNR = BSEG-MATNR.
    4.7 If SY-BATCH = INITIAL AND GV_MTART <> ‘ROH’, issue the error message - “Maintain the mapping of product hierarchy <PRDHA> from article <MATNR> for <BUKRS>”. Else, go to step 3.8.
    4.8 If SY-BATCH <> INITIAL AND GV_MTART <> ‘ROH’, issue the error message - “Maintain product hierarchy on article master”. Go to step 3.10.
    4.9 Move GV_GSBER TO BSEG-GSBER.
    4.10 Exit Routine
    plz give me reply asap --this is very urgent
    thanks in advance
    swathi

    Hi Swathi,
    If it's very very urgent then you better get on with it, don't waste time on the web. Chop chop.

  • Performance issue in BI due to direct query on BKPF and BSEG tables

    Hi,
    We had a requirement that FI document number fieldshould be extracted in BI.
    Following code was written which has the correct logic but performance is bad.
    It fetched just 100 records in more than 4-5 hrs.
    The reason is there was a direct qury written on BSEG and BKPF tables(without WHERE clause).
    Is there any way to improve this code like adding GJAHR field  in where clause? I dont want to change the logic.
    Following is the code:
    WHEN '0CO_OM_CCA_9'." Data Source
        TYPES:BEGIN OF ty_bkpf,
        belnr TYPE bkpf-belnr,
        xblnr TYPE bkpf-xblnr,
        bktxt TYPE bkpf-bktxt,
        awkey TYPE bkpf-awkey,
        bukrs TYPE bkpf-bukrs,
        gjahr TYPE bkpf-gjahr,
        AWTYP TYPE bkpf-AWTYP,
        END OF ty_bkpf.
        TYPES : BEGIN OF ty_bseg1,
        lifnr TYPE bseg-lifnr,
        belnr TYPE bseg-belnr,
        bukrs TYPE bseg-bukrs,
        gjahr TYPE bseg-gjahr,
        END OF ty_bseg1.
        DATA: it_bkpf TYPE STANDARD TABLE OF ty_bkpf,
        wa_bkpf TYPE ty_bkpf,
        it_bseg1 TYPE STANDARD TABLE OF ty_bseg1,
        wa_bseg1 TYPE ty_bseg1,
        l_s_icctrcsta1 TYPE icctrcsta1.
        "Extract structure for Datasoure 0co_om_cca_9.
        DATA: l_awkey TYPE bkpf-awkey.
        DATA: l_gjahr1 TYPE gjahr.
        DATA: len TYPE i,
        l_cnt TYPE i.
        l_cnt = 10.
        tables : covp.
        data : ref_no(20).
        SELECT lifnr
        belnr
        bukrs
        gjahr
        FROM bseg
        INTO TABLE it_bseg1.
        DELETE ADJACENT DUPLICATES FROM it_bseg1 COMPARING belnr gjahr .
        SELECT belnr
        xblnr
        bktxt
        awkey
        bukrs
        gjahr
        AWTYP
        FROM bkpf
        INTO TABLE it_bkpf.
        IF sy-subrc EQ 0.
          CLEAR: l_s_icctrcsta1,
          wa_bkpf,
          l_awkey,
          wa_bseg1.
          LOOP AT c_t_data INTO l_s_icctrcsta1.
            MOVE l_s_icctrcsta1-fiscper(4) TO l_gjahr1.
          select single AWORG AWTYP INTO CORRESPONDING FIELDS OF COVP FROM COVP
          WHERE belnr = l_s_icctrcsta1-belnr.
          if sy-subrc = 0.
              if COVP-AWORG is initial.
           concatenate l_s_icctrcsta1-refbn '%' into ref_no.
                  READ TABLE it_bkpf INTO wa_bkpf WITH KEY awkey(10) =
                  l_s_icctrcsta1-refbn
                  awtyp = COVP-AWTYP
                  gjahr = l_gjahr1.
            IF sy-subrc EQ 0.
              MOVE wa_bkpf-belnr TO l_s_icctrcsta1-zzbelnr.
              MOVE wa_bkpf-xblnr TO l_s_icctrcsta1-zzxblnr.
              MOVE wa_bkpf-bktxt TO l_s_icctrcsta1-zzbktxt.
              MODIFY c_t_data FROM l_s_icctrcsta1.
              READ TABLE it_bseg1 INTO wa_bseg1
              WITH KEY
              belnr = wa_bkpf-belnr
              bukrs = wa_bkpf-bukrs
              gjahr = wa_bkpf-gjahr.
              IF sy-subrc EQ 0.
                MOVE wa_bseg1-lifnr TO l_s_icctrcsta1-lifnr.
                MODIFY c_t_data FROM l_s_icctrcsta1.
                CLEAR: l_s_icctrcsta1,
                wa_bseg1,
                l_gjahr1.
              ENDIF.
            ENDIF.
                ELSE. " IF AWORG IS NOT BLANK -
                concatenate l_s_icctrcsta1-refbn COVP-AWORG into ref_no.
                READ TABLE it_bkpf INTO wa_bkpf WITH KEY awkey(20) =
                ref_no
                awtyp = COVP-AWTYP
                gjahr = l_gjahr1.
            IF sy-subrc EQ 0.
              MOVE wa_bkpf-belnr TO l_s_icctrcsta1-zzbelnr.
              MOVE wa_bkpf-xblnr TO l_s_icctrcsta1-zzxblnr.
              MOVE wa_bkpf-bktxt TO l_s_icctrcsta1-zzbktxt.
              MODIFY c_t_data FROM l_s_icctrcsta1.
              READ TABLE it_bseg1 INTO wa_bseg1
              WITH KEY
              belnr = wa_bkpf-belnr
              bukrs = wa_bkpf-bukrs
              gjahr = wa_bkpf-gjahr.
              IF sy-subrc EQ 0.
                MOVE wa_bseg1-lifnr TO l_s_icctrcsta1-lifnr.
                MODIFY c_t_data FROM l_s_icctrcsta1.
                CLEAR: l_s_icctrcsta1,
                wa_bseg1,
                l_gjahr1.
              ENDIF.
            ENDIF.
               endif.
          endif.
            CLEAR: l_s_icctrcsta1.
            CLEAR: COVP, REF_NO.
          ENDLOOP.
        ENDIF.

    Hello Amruta,
    I was just looking at your coding:
    LOOP AT c_t_data INTO l_s_icctrcsta1.
    MOVE l_s_icctrcsta1-fiscper(4) TO l_gjahr1.
    select single AWORG AWTYP INTO CORRESPONDING FIELDS OF COVP FROM COVP
    WHERE belnr = l_s_icctrcsta1-belnr.
    if sy-subrc = 0.
    if COVP-AWORG is initial.
    concatenate l_s_icctrcsta1-refbn '%' into ref_no.
    READ TABLE it_bkpf INTO wa_bkpf WITH KEY awkey(10) =
    l_s_icctrcsta1-refbn
    awtyp = COVP-AWTYP
    gjahr = l_gjahr1.
    Here you are interested in those BKPF records that are related to the contents of c_t_data internal table.
    I guess that this table does not contain millions of entries. Am I right?
    If yes, the the first step would be to pre-select COVP entries:
    select BELNR AWORG AWTYP into lt_covp from COVP
    for all entries in c_t_data
    where belnr = c_t_data-belnr.
    sort lt_covp by belnr.
    Once having this data ready, you build an internal table for BKPF selection:
    LOOP AT c_t_data INTO l_s_icctrcsta1.
      clear ls_bkpf_sel.
      ls_bkpf_sel-awkey(10) = l_s_icctrcsta1-refbn.
      read table lt_covp with key belnr = l_s_icctrcsta1-belnr binary search.
      if sy-subrc = 0.
        ls_bkpf_sel-awtyp = lt_covp-awtyp.
      endif.
      ls_bkpf_sel-gjahr = l_s_icctrcsta1-fiscper(4).
      insert ls_bkpf_sel into table lt_bkpf_sel.
    ENDLOOP.
    Now you have all necessary info to read BKPF:
    SELECT
    belnr
    xblnr
    bktxt
    awkey
    bukrs
    gjahr
    AWTYP
    FROM bkpf
    INTO TABLE it_bkpf
    for all entries in lt_bkpf_sel
    WHERE
      awkey = lt_bkpf_sel-awkey and
      awtyp = lt_bkpf_sel-awtype and
      gjahr = lt_bkpf_sel-gjahr.
    Then you can access BSEG with the bukrs, belnr and gjahr from the selected BKPF entries. This will be fast.
    Moreover I would even try to make a join on DB level. But first try this solution.
    Regards,
      Yuri

  • One to One link between VBRP items and BSEG items

    Hi All,
    I am working on a program where I have to link between VBRP table items against BSEG table items.
    But in BSEG, the invoice items are summarised based on Material Number, profit center etc..
    Is there a way to divide them, like any other table which holds the data transferred to accounting from sales exactly as it is in the invoice tables (VBRP).
    If there is no such table, can any one help me figure out a logic where I can didvide the items of BSEG table exactly like the items of table  VBRP.
    Any help or input will be very highly appreciated.
    Thanks in advance
    Phani

    Thanks for the Replies Ramani and Monika...
    I alraedy have a relation between the Accounting Doc and Billing Doc (VBRP-vbeln to BSEG-belnr).
    what I am looking for is the Item wise one to one mapping.
    i.e  Assume that we have 4 items in VBRP under one Billing Doc....
    2 items have Similar Materials (Assume XYZ) and same Profit center (eq..MNO123)
    and the Other 2 items have material (ABC) and Profit center (PQR6789).
    Now these appear in Bseg as only 2 items, all the items with similar materials, profit center etc will be clubbed in Bseg (While Accounting). I.e In BSEG you will only find 2 entries for the above 4 items of VBRP.
    I need to divide the data that I am getting from BSEG exactly as they are in VBRP.
    Pls suggest if you know of any table where I can find this.....If not a table.., then a way to figure out the division of these BSEG items exactly as the VBRP items.
    Brgds
    Phani

  • How to write code for this logic, plz help me very urgent

    Hi All,
    i am new to sap-abap, i got this work and i m working on this can any body help me in writing code, plz help me, this is very very urgent.
    here  i m giving my logic, can anybody send me the code related to this logic.
    this is very urgent .
    this program o/p should be in ALV format and need to create one commond 'SAVE" on this o/t list  if  user clicks save processedon and processedby fields in ZFIBUE should be updated automatically.
    i am creating one custom table zfibue having fields: (serialno, bukrs, matnr,prdha,hkont,gsber,wrbtr,budat, credate, cretime,processed, processedon, processedby,mapped)
    fields of zfibue:
    serailno = numc
    bukrs = char
    matnr = char
    prdha = char
    hkont = char
    gsber = char
    wrbtr = char
    budat = date
    credate = date
    cretime = time
    processed= char
    processedon = date
    processedby = char
    mapped = char      are   belongs to above type data types
    and seelct-optionfields:  s_bukrs for bseg-bukrs
                                        s_hkont for bseg-hkont,
                                         s_budat for bkpf-budat,
                                         s_processed for zfibue-processed,
                                          s_processedon for zfibue-processedon,
                                          s_mapped. for zfibue-mapped
    parameters: p_chk1 as checkbox,
                      p_chk2 as checkbox.
                      p_filepath type rlgrap-filename.
    1.1 Validate the user inputs (S_BUKRS and S_HKONT) against respective check tables (T001 and SKB1). If the validation fails, provide respective error message. Eg: “Invalid input for Company Code”.
    1.2 Fetch SERIALNO, BUKRS, MATNR, PRDHA, HKONT, GSBER, WRBTR, BUDAT, CREDATE, CRETIME, PROCESSED, PROCESSEDON, PROCESSEDBY, MAPPED from table ZFIBUE into internal table GT_ZFIBUE where BUKRS IN S_BUKRS, HKONT IN S_HKONT, BUDAT IN S_BUDAT, PROCESSED IN S_PROCESSED, PROCESSEDON IN S_PROCESSEDON, and MAPPED IN S_MAPPED.
    1.3 If P_CHK2 = ‘X’, go to step 1.11. Else continue.
    1.4 If P_CHK1 = ‘X’, continue. Else go to step 1.9
    1.5 Fetch MATNR, PRDHA from MARA into GT_MARA for all entries in GT_ZFIBUE where MATNR = GT_ZFIBUE-MATNR.
    1.6 Sort and delete adjacent duplicates from GT_MARA based on MATNR.
    1.7 Loop through GT_ZFIBUE where PRDHA = blank.
              Read Table GT_MARA based on MATNR = GT_ZFIBUE-MATNR.
              IF sy-subrc = 0.
                     Move GT_MARA-PRDHA to GT_ZFIBUE-PRDHA.
                  Modify Table GT_ZFIBUE. “Update Product Hierarchy
                 Endif.
        Fetch PRDHA, GSBER from ZFIBU into GT_ZFIBU for all entries in GT_ZFIBUE where PRDHA = GT_ZFIBUE-PRDHA.
        Read Table GT_ZFIBU based on PRDHA = GT_ZFIBUE-PRDHA.
              IF sy-subrc = 0.
                     Move GT_ZFIBU-GSBER to GT_ZFIBUE-GSBER.
                  Move “X” to GT_ZFIBUE-MAPPED.      
                  Modify Table GT_ZFIBUE.
                 Endif.   
    Endloop.
    1.8 Modify database table ZFIBUE from GT_ZFIBUE.
    1.9 Fill the field catalog table GT_FIELDCAT using the details of output fields listed in section “Inputs/Outputs” (above).
       Eg:                 LWA_ FIELDCAT -SELTEXT_L = 'Serial Number’.
                              LWA_ FIELDCAT -DATATYPE = ‘NUMC’.
                              LWA_ FIELDCAT -OUTPUTLEN = 9.
                              LWA_ FIELDCAT -TABNAME = 'GT_ZFIBUE'.
                              LWA_ FIELDCAT-FIELDNAME = 'SERIALNO'.
              Append LWA_FIELDCAT to GT_FIELDCAT
    Note: a) The output field GT_ZFIBUE-PROCESSED will be editable marking INPUT = “X” in field catalog (GT_FIELDCAT).
             b) The standard ALV functionality will be used to give the user option for selecting all or blocks of entries at a time.
             c) The PF-STATUS STANDARD_FULLSCREEN from function group SLVC_FULLSCREEN will be copied to the program and modified to include a “SAVE” button.
    1.10 Call the function module REUSE_ALV_GRID_DISPLAY passing output table GT_ZFIBUE and field catalog GT_FIELDCAT. Additional parameters like I_CALLBACK_PF_STATUS_SET (= ‘ZFIBUESTAT’) and I_CALLBACK_USER_COMMAND (=’HANDLE_USER_ACTION’) will also be passed to handle user events. Go to 2.14.
    1.11 Download the file to P_FILEPATH using function module GUI_DOWNLOAD passing GT_ZFIBUE.
    1.12 Exit Program.
    Logic to be implemented in  routine “Handle_User_Action”
    This routine will have the following interface:
    FORM Handle_User_Action  USING r_ucomm LIKE sy-ucomm
                                                               rs_selfield TYPE slis_selfield.
    ENDFORM.
    Following logic will be implemented in this routine:
    1.     If r_ucomm = ‘SAVE’, continue. Else exit.
    2.     Loop through GT_ZFIBUE where SEL_ROW = ‘X’. “Row is selected
    a.     IF GT_ZFIBUE-PROCESSED = ‘X’.
    i.     GT_ZFIBUE-PROCESSEDON = SY-DATUM.
    ii.     GT_ZFIBUE-PROCESSEDBY = SY-UNAME.
    iii.     MODIFY ZFIBUE FROM work area GT_ZFIBUE.
    Endif.
    Endloop.

    Hi Swathi,
    If it's very very urgent then you better get on with it, don't waste time on the web. Chop chop.

  • Field BSEG-HKTID does not exist in the additional data Screen

    Hi
    We are facing a problem while posting the parked document. Field BSEG-HKTID does not exist in the screen SAPLF040 0331.
    As we want to avoid entering the field-data at the time of payment proposal run using T.code F110, we prefer to enter at the time of posting a parked document or at the time of parking.
    We had checked the field status (of Posting key and GL) and its not available.
    We refered note 953374 House bank details: Account ID in the document. It asks to activate the RE-FX component. However, we are not in the real estate business hence not logical to do so. How do we need to proceed?
    PP

    To do the same change with the transaccion FB02 y FB03, create an enhancemente point in the program: SAPMF05L dynpro: 1301, module: DYNPRO_MODIFIKATION, at the of perform open_fi_dynpro_mod and write:
    LOOP AT SCREEN.
      IF sy-tcode = 'FB02'.
        IF screen-name = 'BSEG-HKTID'.
          screen-input = 1.
          screen-invisible = 0.
          screen-active = 1.
          screen-output = 1.
          screen-group4 = ' '.
          MODIFY SCREEN.
          EXIT.
        ENDIF.
      elseif sy-tcode = 'FB03'.
          IF screen-name = 'BSEG-HKTID'.
          screen-input = 0.
          screen-invisible = 0.
          screen-active = 1.
          screen-output = 1.
          screen-group4 = ' '.
          MODIFY SCREEN.
          EXIT.
        ENDIF.
      endif.
      ENDLOOP.
    and, all ready.

  • Logical database for vendor cleared items

    Hi,
    What is the logical database for vendor cleared items.  KDF is giving me only open items. 
    Actually I am preparing a report which uses vendor cleared items and trying to get the list from BSAK table.  Which would be the better way (faster process for better performance)
    a) directly fetching data from database table like BSAK or
    b) by using logical database
    any ideas please.
    regards,
    mallik

    If  just display of all cleared items in a report,  then i would suggest you to go for Query development instead of a z report and use BSAK. Being Index table and query, we can reduce several errors in logic/easy to develop/less time.
    If you need Z report only, then also, you can go for BSAK. Where as BASK is secondary index table which helps to fetch data fast.
    In one way, BSEG - BSIK = BSAK for your case!
    Regards
    Sridevi

  • Logical Database BRF

    For a report using logical database BRF where have to print invoice no with tax details and other line item details.
    First reading BSEG using
    GET BSEG.
    then
    GET BSET.
    now want to retreive material no &  quantity from table BSEG. how to write logic for that.
    Kindly help.
    anya

    Dude LDB gives me one extra selection  parameter   but i need not that parameter ...
    Is ther any way by which i remove that  selection parameter and add up my new paramere ...
    The same thing  i done in pnp LDB  but i am unable to do  same in brf LDB. 
    Beaus in PNP there is "HR report  category "  BY which i cam made  >>>>

Maybe you are looking for

  • How can I get my Microsoft Outlook messages and contacts onto my new M-Book

    I need to get my messages and contacts from Microsoft Outlook(not Outlook Express) into Entourage on my new MacBook Pro. Can anyone please help? Thanks.

  • Partner Function Issue

    Dear all, I have an issue wherin the system is allowing me to change the Ship To in the sales order and this Ship to is not a part of the Partner to sold to and the order is allowing me to enter any SHip To and getting Saved. Can you pls let me know

  • Problem logging in sql plus

    If you are running Personal Oracle, you do not need to give host string to log in SQL Plus. However, database should be started up first. In order to run SQL Plus on a client workstation in client- server environment, you should create a host string

  • I am unable to download the latest version of adobe reader

    I have widows vista and use internet explorer 8.and have clear out the old one what is wrong. It is ok to 59% and then nothing more happend

  • Video thumbnails that link to other menus, not timelines

    In DVDSP(Which I am trying to get rid of at the office) we could do a video thumbnail(drop object) that would play a short video loop but link to a submenu instead of the timeline of that video. Is there a way to do this in Encore? Much Thanks! Beto