Substitution in BSAK table

In FI module, would  it be  possible to do a substitution through GBB1 in BSAK table, or only would it be possible in BSEG and BKPF?
Thanks in advance, apañeros

BSAK is an index table with redundant data from BKPF and BSEG, filled via MOVE-CORRESPONDING, so fields of the same name in BSAK as in BKPF/BSEG should show the same substituted value (if the field is allowed for substitution).
Try it out if in doubt.
Thomas

Similar Messages

  • WBS and NPLNR for Vendor Items in BSIK and BSAK  Table

    Hi  FI Experts,
    I created a PR for Network  . While creating PO for the PR  the network values are flowing into  PS_PSP_PNR and NPLNR of EKKN fields  .
    While doing a MIGO also the WBS and NPLNR are flowing to MSEG table  appropriate fields .
    While doing a MIRO transaction for PO   the vendor line item  posted in BSIK table populated with  neither WBS nor NPLNR (Network).
    When  payment is made for Invoice the clearing document(Payment Document)  from BSAK table should be populated with either WBS or NPLNR .
    Could you  please suggest if I need to manually run some transaction to get them Popluated .
    All the above helps me in writing a Vendor and Project wise outstanding balances report .
    Thanks in Advance ..
    Regards,
    Kishore.S

    Hi Srinivas,
    The minimun field required to make a vendor posting are as follows,
            wa_vendoritem-itemno_acc  = gv_count.
            wa_vendoritem-vendor_no    =  wa_vendor-newko.
            wa_vendoritem-item_text     = wa_vendor-sgtxt.
            wa_vendoritem-comp_code  = wa_vendor-bukrs.
            wa_vendoritem-pmnttrms     = wa_vendor-zterm.
            wa_vendoritem-bline_date   = wa_vendor-zfbdt.
            wa_vendoritem-item_text    = wa_vendor-sgtxt.
            wa_vendoritem-tax_code    = wa_vendor-mwskz.
            wa_vendoritem-profit_ctr     = wa_vendor-prctr.
    I think you missed the profir centre field which is mandatory for a vendor posting,or if is a new gl, it will derive the profit centre from the cost centre of the previous line(i.e. G/L line).  if it is not a new G/l , then you need to manually find the profit centre from cost centre and put the values. So double check passing these field , it should be working. Still have doubts please contact me.
    regards,
    Shobana.K
    Edited by: Shobana k on Jan 8, 2009 8:05 AM
    Code Formatted by: Alvaro Tejada Galindo on Jan 8, 2009 4:01 PM

  • BSAK Table -Index Issue

    Hi All,
    I want to access BSAK table based on following fields: BUKRS, LIFNR, ZUONR, BLART and BSCHL.
    It is not having any index which fully matches with the criteria we are providing in Where clause. Hence it's using index '4' (BSAK~4) which is partly accessed.
    But this is taking huge amount of time. When I checked the cost of the select statement, estimated cost was 21617 (Which is pretty high) and storage quality of this index is 87%. I think that the rebuilding index would be not help us much.
    I suggested creating of secondary index but the basis team is not happy with this suggestion as this would require disk space.
    So Can you please suggest what can be done or if I can access any other index?
    Regards,
    Pooja

    Hi,
    >I want to access BSAK table based on following fields: BUKRS, LIFNR, ZUONR, BLART and BSCHL.
    Index 0 looks better i think:
    MANDT  <-specified
    BUKRS  <-specified
    LIFNR    <-specified
    UMSKS
    UMSKZ
    AUGDT
    AUGBL
    ZUONR  <-specified (can be used as a filter only)
    GJAHR
    BELNR
    BUZEI
    Index 4 doesn't look so good:
    MANDT  <-specified
    BUKRS   <-specified
    REBZG
    REBZJ
    REBZZ
    LIFNR    <-specified (can be used as a filter only)
    UMSKS
    REBZT
    Double check your statistics. Are they reflecting the current state of the table? If in doubt, update them.
    You can try to force the query to use index 0 in order to see if the run time improves.
    Kind regards,
    Hermann

  • Handling substitution groups and Tables generation

    Hi
    This is concerning the generation of tables from xml schema containing "substitutionGroup" attributes and "extension" elements for
    deriving from abstract types.
    I want to know how the tables are generated when schema has subsitution groups.
    I went through the generated tables and observed that it creates a table for each extension...but also generates a table for the head of the subsitution group.
    This table would have columns for each of the members in the derivatives of the abstract type.This is resulting in more than 1000 columns in my case
    Any suggestions?
    Thanks
    Devashish

    When a subsitution group is used each of the type of each of the elements in the substition group must be an extension of the type of the head element. In the case where the head type is based on an abstract empty complexType this makes no sense. Since the type inheritiance system implies that anywhere a parent type can appear it is legal for the chlild type to appear in it's place we have to create a storage structure for the head element which can handle any of the possible child types. This means that at the storage level we have to generate a table with a column for each possible descendant of the head element. This means that we are effectively restricting the number of direct elements and attributes that can be defined by members of the substition group to a number that is a little less than 1000.
    This can be be seen in the first example below.
    However in the case where the substition group contains no common element we can model this as choice. as is shown in the second XML Schema. Since every member of the choice is independant of the other members of the choice there is no need for the inheritance hierarchy in the type definitions. This means that each member of the choice can now be mapped to a seperate table. This structure allows for a choice with approxamately a 1000 entries and no practicle limits on the number of decendant elements and attributes for each member of the choice..
    This can be seen in the second example bleow;
    The key point is the number of columns in ROOT_TABLE. In the First Example it is 17, the fixed overhead plus the number of columns required to persist headType, member1Type and member2Type. In the Second example it is 12, the fixed overhead plus a REF XMLType to point at instances of member1Type and REF XMLType to point at instnaces of member2Type.
    I hope this answers your question
    SQL> var schemaURL varchar2(256)
    SQL> var schemaPath varchar2(256)
    SQL> --
    SQL> column qualified_col_name format A64
    SQL> column data_type format A40
    SQL> --
    SQL> set lines 150 pages 25 long 10000
    SQL> --
    SQL> begin
      2    :schemaURL := 'testcase.xsd';
      3    :schemaPath := '/public/testcase.xsd';
      4  end;
      5  /
    PL/SQL procedure successfully completed.
    SQL> call dbms_xmlSchema.deleteSchema(:schemaURL,4)
      2  /
    Call completed.
    SQL> declare
      2    res boolean;
      3    xmlSchema xmlType := xmlType(
      4  '<?xml version="1.0" encoding="UTF-8"?>
      5  <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xdb="http://xmlns.oracle.com/xdb" elementFormDefault="qualified" attribute
    FormDefault="unqualified" xdb:storeVarrayAsTable="true">
      6     <xs:element name="root" type="rootType" xdb:defaultTable="ROOT_TABLE"/>
      7     <xs:complexType name="rootType" xdb:SQLType="ROOT_T">
      8             <xs:sequence>
      9                     <xs:element ref="head"/>
    10             </xs:sequence>
    11     </xs:complexType>
    12     <xs:complexType name="headType" xdb:SQLType="HEAD_T" abstract="true"/>
    13     <xs:complexType name="member1Type" xdb:SQLType="MEMBER1_T">
    14             <xs:complexContent>
    15                     <xs:extension base="headType">
    16                             <xs:sequence>
    17                                     <xs:element name="Member1.Child1" type="xs:string"/>
    18                                     <xs:element name="Member1.Child2" type="xs:string"/>
    19                             </xs:sequence>
    20                     </xs:extension>
    21             </xs:complexContent>
    22     </xs:complexType>
    23     <xs:complexType name="member2Type" xdb:SQLType="MEMBER2_T">
    24             <xs:complexContent>
    25                     <xs:extension base="headType">
    26                             <xs:sequence>
    27                                     <xs:element name="Member2.Child1" type="xs:string"/>
    28                                     <xs:element name="Member2.Child2" type="xs:string"/>
    29                             </xs:sequence>
    30                     </xs:extension>
    31             </xs:complexContent>
    32     </xs:complexType>
    33     <xs:element name="head" type="headType" xdb:defaultTable="GLOBAL_HEAD_TABLE"/>
    34     <xs:element name="member1" type="member1Type" substitutionGroup="head" xdb:defaultTable="GLOBAL_MEMBER1_TABLE"/>
    35     <xs:element name="member2" type="member2Type" substitutionGroup="head" xdb:defaultTable="GLOBAL_MEMBER2_TABLE"/>
    36  </xs:schema>');
    37  begin
    38    if (dbms_xdb.existsResource(:schemaPath)) then
    39      dbms_xdb.deleteResource(:schemaPath);
    40    end if;
    41    res := dbms_xdb.createResource(:schemaPath,xmlSchema);
    42  end;
    43  /
    PL/SQL procedure successfully completed.
    SQL> begin
      2    dbms_xmlschema.registerSchema
      3    (
      4      :schemaURL,
      5      xdbURIType(:schemaPath).getClob(),
      6      TRUE,TRUE,FALSE,TRUE
      7    );
      8  end;
      9  /
    PL/SQL procedure successfully completed.
    SQL> --
    SQL> desc ROOT_TABLE
    Name                                                                                Null?    Type
    TABLE of SYS.XMLTYPE(XMLSchema "testcase.xsd" Element "root") STORAGE Object-relational TYPE "ROOT_T"
    SQL> --
    SQL> desc ROOT_T
    ROOT_T is NOT FINAL
    Name                                                                                Null?    Type
    SYS_XDBPD$                                                                                   XDB.XDB$RAW_LIST_T
    head                                                                                         HEAD_T
    SQL> --
    SQL> desc HEAD_T
    HEAD_T is NOT FINAL
    HEAD_T is NOT INSTANTIABLE
    Name                                                                                Null?    Type
    SYS_XDBPD$                                                                                   XDB.XDB$RAW_LIST_T
    SQL> --
    SQL> desc GLOBAL_HEAD_TABLE
    Name                                                                                Null?    Type
    TABLE of SYS.XMLTYPE(XMLSchema "testcase.xsd" Element "head") STORAGE Object-relational TYPE "HEAD_T"
    SQL> --
    SQL> desc GLOBAL_MEMBER1_TABLE
    Name                                                                                Null?    Type
    TABLE of SYS.XMLTYPE(XMLSchema "testcase.xsd" Element "member1") STORAGE Object-relational TYPE "MEMBER1_T"
    SQL> --
    SQL> desc MEMBER1_T
    MEMBER1_T extends SCOTT.HEAD_T
    MEMBER1_T is NOT FINAL
    Name                                                                                Null?    Type
    SYS_XDBPD$                                                                                   XDB.XDB$RAW_LIST_T
    Member1.Child1                                                                               VARCHAR2(4000 CHAR)
    Member1.Child2                                                                               VARCHAR2(4000 CHAR)
    SQL> --
    SQL> desc GLOBAL_MEMBER2_TABLE
    Name                                                                                Null?    Type
    TABLE of SYS.XMLTYPE(XMLSchema "testcase.xsd" Element "member2") STORAGE Object-relational TYPE "MEMBER2_T"
    SQL> --
    SQL> desc MEMBER2_T
    MEMBER2_T extends SCOTT.HEAD_T
    MEMBER2_T is NOT FINAL
    Name                                                                                Null?    Type
    SYS_XDBPD$                                                                                   XDB.XDB$RAW_LIST_T
    Member2.Child1                                                                               VARCHAR2(4000 CHAR)
    Member2.Child2                                                                               VARCHAR2(4000 CHAR)
    SQL> --
    SQL> select qualified_col_name, data_type from user_tab_cols where table_name = 'ROOT_TABLE'
      2  /
    QUALIFIED_COL_NAME                                               DATA_TYPE
    SYS_NC_OID$                                                      RAW
    SYS_NC_ROWINFO$                                                  XMLTYPE
    XMLEXTRA                                                         XMLTYPEEXTRA
    "XMLEXTRA"."NAMESPACES"                                          XMLTYPEPI
    "XMLEXTRA"."EXTRADATA"                                           XMLTYPEPI
    XMLDATA                                                          ROOT_T
    SYS_TYPEID("XMLDATA")                                            RAW
    "XMLDATA"."SYS_XDBPD$"                                           XDB$RAW_LIST_T
    "XMLDATA"."head"                                                 HEAD_T
    SYS_TYPEID("XMLDATA"."head")                                     RAW
    "XMLDATA"."head"."SYS_XDBPD$"                                    XDB$RAW_LIST_T
    TREAT("XMLDATA"."head" AS "MEMBER2_T")."Member2.Child1"          VARCHAR2
    TREAT("XMLDATA"."head" AS "MEMBER2_T")."Member2.Child2"          VARCHAR2
    TREAT("XMLDATA"."head" AS "MEMBER1_T")."Member1.Child1"          VARCHAR2
    TREAT("XMLDATA"."head" AS "MEMBER1_T")."Member1.Child2"          VARCHAR2
    ACLOID                                                           RAW
    OWNERID                                                          RAW
    17 rows selected.
    SQL> select qualified_col_name, data_type from user_tab_cols where table_name = 'GLOBAL_MEMBER1_TABLE'
      2  /
    QUALIFIED_COL_NAME                                               DATA_TYPE
    SYS_NC_OID$                                                      RAW
    SYS_NC_ROWINFO$                                                  XMLTYPE
    XMLEXTRA                                                         XMLTYPEEXTRA
    "XMLEXTRA"."NAMESPACES"                                          XMLTYPEPI
    "XMLEXTRA"."EXTRADATA"                                           XMLTYPEPI
    XMLDATA                                                          MEMBER1_T
    SYS_TYPEID("XMLDATA")                                            RAW
    "XMLDATA"."SYS_XDBPD$"                                           XDB$RAW_LIST_T
    "XMLDATA"."Member1.Child1"                                       VARCHAR2
    "XMLDATA"."Member1.Child2"                                       VARCHAR2
    ACLOID                                                           RAW
    OWNERID                                                          RAW
    12 rows selected.
    SQL> select qualified_col_name, data_type from user_tab_cols where table_name = 'GLOBAL_MEMBER2_TABLE'
      2  /
    QUALIFIED_COL_NAME                                               DATA_TYPE
    SYS_NC_OID$                                                      RAW
    SYS_NC_ROWINFO$                                                  XMLTYPE
    XMLEXTRA                                                         XMLTYPEEXTRA
    "XMLEXTRA"."NAMESPACES"                                          XMLTYPEPI
    "XMLEXTRA"."EXTRADATA"                                           XMLTYPEPI
    XMLDATA                                                          MEMBER2_T
    SYS_TYPEID("XMLDATA")                                            RAW
    "XMLDATA"."SYS_XDBPD$"                                           XDB$RAW_LIST_T
    "XMLDATA"."Member2.Child1"                                       VARCHAR2
    "XMLDATA"."Member2.Child2"                                       VARCHAR2
    ACLOID                                                           RAW
    OWNERID                                                          RAW
    12 rows selected.
    SQL> insert into ROOT_TABLE values( XMLType (
      2  '<root>
      3    <member1>
      4      <Member1.Child1>AAA</Member1.Child1>
      5      <Member1.Child2>BBB</Member1.Child2>
      6    </member1>
      7  </root>'))
      8  /
    1 row created.
    SQL> insert into ROOT_TABLE values( XMLType (
      2  '<root>
      3    <member2>
      4      <Member2.Child1>CCC</Member2.Child1>
      5      <Member2.Child2>DDD</Member2.Child2>
      6    </member2>
      7  </root>'))
      8  /
    1 row created.
    SQL> set long 1000 pages 20
    SQL> --
    SQL> select * from ROOT_TABLE
      2  /
    SYS_NC_ROWINFO$
    <root>
      <member1>
        <Member1.Child1>AAA</Member1.Child1>
        <Member1.Child2>BBB</Member1.Child2>
      </member1>
    </root>
    <root>
      <member2>
        <Member2.Child1>CCC</Member2.Child1>
        <Member2.Child2>DDD</Member2.Child2>
      </member2>
    </root>
    SQL> var schemaURL varchar2(256)
    SQL> var schemaPath varchar2(256)
    SQL> --
    SQL> begin
      2    :schemaURL := 'testcase.xsd';
      3    :schemaPath := '/public/testcase.xsd';
      4  end;
      5  /
    PL/SQL procedure successfully completed.
    SQL> call dbms_xmlSchema.deleteSchema(:schemaURL,4)
      2  /
    Call completed.
    SQL> declare
      2    res boolean;
      3    xmlSchema xmlType := xmlType(
      4  '<?xml version="1.0" encoding="UTF-8"?>
      5  <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xdb="http://xmlns.oracle.com/xdb" elementFormDefault="qualified" attribute
    FormDefault="unqualified" xdb:storeVarrayAsTable="true">
      6     <xs:element name="root" type="rootType" xdb:defaultTable="ROOT_TABLE"/>
      7     <xs:complexType name="rootType" xdb:SQLType="ROOT_T">
      8             <xs:choice>
      9                     <xs:element ref="member1" xdb:SQLInline="false" xdb:defaultTable="MEMBER1_TABLE"/>
    10                     <xs:element ref="member2" xdb:SQLInline="false" xdb:defaultTable="MEMBER2_TABLE"/>
    11             </xs:choice>
    12     </xs:complexType>
    13     <xs:complexType name="member1Type" xdb:SQLType="MEMBER1_T">
    14                             <xs:sequence>
    15                                     <xs:element name="Member1.Child1" type="xs:string"/>
    16                                     <xs:element name="Member1.Child2" type="xs:string"/>
    17                             </xs:sequence>
    18     </xs:complexType>
    19     <xs:complexType name="member2Type" xdb:SQLType="MEMBER2_T">
    20                             <xs:sequence>
    21                                     <xs:element name="Member2.Child1" type="xs:string"/>
    22                                     <xs:element name="Member2.Child2" type="xs:string"/>
    23                             </xs:sequence>
    24     </xs:complexType>
    25     <xs:element name="member1" type="member1Type"  xdb:defaultTable="GLOBAL_MEMBER1_TABLE"/>
    26     <xs:element name="member2" type="member2Type" xdb:defaultTable="GLOBAL_MEMBER2_TABLE"/>
    27  </xs:schema>');
    28  begin
    29    if (dbms_xdb.existsResource(:schemaPath)) then
    30      dbms_xdb.deleteResource(:schemaPath);
    31    end if;
    32    res := dbms_xdb.createResource(:schemaPath,xmlSchema);
    33  end;
    34  /
    PL/SQL procedure successfully completed.
    SQL> begin
      2    dbms_xmlschema.registerSchema
      3    (
      4      :schemaURL,
      5      xdbURIType(:schemaPath).getClob(),
      6      TRUE,TRUE,FALSE,TRUE
      7    );
      8  end;
      9  /
    PL/SQL procedure successfully completed.
    SQL> --
    SQL> desc ROOT_TABLE
    Name                                                                                Null?    Type
    TABLE of SYS.XMLTYPE(XMLSchema "testcase.xsd" Element "root") STORAGE Object-relational TYPE "ROOT_T"
    SQL> --
    SQL> desc ROOT_T
    ROOT_T is NOT FINAL
    Name                                                                                Null?    Type
    SYS_XDBPD$                                                                                   XDB.XDB$RAW_LIST_T
    member1                                                                                      REF OF XMLTYPE
    member2                                                                                      REF OF XMLTYPE
    SQL> --
    SQL> desc GLOBAL_MEMBER1_TABLE
    Name                                                                                Null?    Type
    TABLE of SYS.XMLTYPE(XMLSchema "testcase.xsd" Element "member1") STORAGE Object-relational TYPE "MEMBER1_T"
    SQL> --
    SQL> desc MEMBER1_T
    MEMBER1_T is NOT FINAL
    Name                                                                                Null?    Type
    SYS_XDBPD$                                                                                   XDB.XDB$RAW_LIST_T
    Member1.Child1                                                                               VARCHAR2(4000 CHAR)
    Member1.Child2                                                                               VARCHAR2(4000 CHAR)
    SQL> --
    SQL> desc GLOBAL_MEMBER2_TABLE
    Name                                                                                Null?    Type
    TABLE of SYS.XMLTYPE(XMLSchema "testcase.xsd" Element "member2") STORAGE Object-relational TYPE "MEMBER2_T"
    SQL> --
    SQL> desc MEMBER2_T
    MEMBER2_T is NOT FINAL
    Name                                                                                Null?    Type
    SYS_XDBPD$                                                                                   XDB.XDB$RAW_LIST_T
    Member2.Child1                                                                               VARCHAR2(4000 CHAR)
    Member2.Child2                                                                               VARCHAR2(4000 CHAR)
    SQL> --
    SQL> select qualified_col_name, data_type from user_tab_cols where table_name = 'ROOT_TABLE'
      2  /
    QUALIFIED_COL_NAME                                               DATA_TYPE
    SYS_NC_OID$                                                      RAW
    SYS_NC_ROWINFO$                                                  XMLTYPE
    XMLEXTRA                                                         XMLTYPEEXTRA
    "XMLEXTRA"."NAMESPACES"                                          XMLTYPEPI
    "XMLEXTRA"."EXTRADATA"                                           XMLTYPEPI
    XMLDATA                                                          ROOT_T
    SYS_TYPEID("XMLDATA")                                            RAW
    "XMLDATA"."SYS_XDBPD$"                                           XDB$RAW_LIST_T
    "XMLDATA"."member1"                                              XMLTYPE
    "XMLDATA"."member2"                                              XMLTYPE
    ACLOID                                                           RAW
    OWNERID                                                          RAW
    12 rows selected.
    SQL> select qualified_col_name, data_type from user_tab_cols where table_name = 'GLOBAL_MEMBER1_TABLE'
      2  /
    QUALIFIED_COL_NAME                                               DATA_TYPE
    SYS_NC_OID$                                                      RAW
    SYS_NC_ROWINFO$                                                  XMLTYPE
    XMLEXTRA                                                         XMLTYPEEXTRA
    "XMLEXTRA"."NAMESPACES"                                          XMLTYPEPI
    "XMLEXTRA"."EXTRADATA"                                           XMLTYPEPI
    XMLDATA                                                          MEMBER1_T
    SYS_TYPEID("XMLDATA")                                            RAW
    "XMLDATA"."SYS_XDBPD$"                                           XDB$RAW_LIST_T
    "XMLDATA"."Member1.Child1"                                       VARCHAR2
    "XMLDATA"."Member1.Child2"                                       VARCHAR2
    ACLOID                                                           RAW
    OWNERID                                                          RAW
    12 rows selected.
    SQL> select qualified_col_name, data_type from user_tab_cols where table_name = 'GLOBAL_MEMBER2_TABLE'
      2  /
    QUALIFIED_COL_NAME                                               DATA_TYPE
    SYS_NC_OID$                                                      RAW
    SYS_NC_ROWINFO$                                                  XMLTYPE
    XMLEXTRA                                                         XMLTYPEEXTRA
    "XMLEXTRA"."NAMESPACES"                                          XMLTYPEPI
    "XMLEXTRA"."EXTRADATA"                                           XMLTYPEPI
    XMLDATA                                                          MEMBER2_T
    SYS_TYPEID("XMLDATA")                                            RAW
    "XMLDATA"."SYS_XDBPD$"                                           XDB$RAW_LIST_T
    "XMLDATA"."Member2.Child1"                                       VARCHAR2
    "XMLDATA"."Member2.Child2"                                       VARCHAR2
    ACLOID                                                           RAW
    OWNERID                                                          RAW
    12 rows selected.
    SQL> insert into ROOT_TABLE values( XMLType (
      2  '<root>
      3    <member1>
      4      <Member1.Child1>AAA</Member1.Child1>
      5      <Member1.Child2>BBB</Member1.Child2>
      6    </member1>
      7  </root>'))
      8  /
    1 row created.
    SQL> insert into ROOT_TABLE values( XMLType (
      2  '<root>
      3    <member2>
      4      <Member2.Child1>CCC</Member2.Child1>
      5      <Member2.Child2>DDD</Member2.Child2>
      6    </member2>
      7  </root>'))
      8  /
    1 row created.
    SQL> set long 1000 pages 20
    SQL> --
    SQL> select * from ROOT_TABLE
      2  /
    SYS_NC_ROWINFO$
    <root>
      <member1>
        <Member1.Child1>AAA</Member1.Child1>
        <Member1.Child2>BBB</Member1.Child2>
      </member1>
    </root>
    <root>
      <member2>
        <Member2.Child1>CCC</Member2.Child1>
        <Member2.Child2>DDD</Member2.Child2>
      </member2>
    </root>
    SQL>
    SQL>
    SQL>

  • UPDATE SQL string substitution from another table

    Hi - I've come across a tricky situation where I would want to update a column in all the relevant rows of a table with values obtained from another table WITHIN the same column update using string concatenation. im not getting any clean way of doing this.
    The goal is to achieve something like this:
    UPDATE table1 set col1 =
    'LANG_ID=(%s),'||
    '_CHALLENGE_RESPONSE_=(%s),'||
    'CRDN_NAM=(%s),'||
    'CLNT_MODE=(%s),'||
    'PTY_ID=(%s),'||
    'CRDN_VAL=(%s),' ||
    'USER_TZ_COD=(%s),' ||
    'GTS_USER_ID=(%s),'||
    'SP_ID=(%s),' ||
    'SP_ALIAS=(%s),' ||
    'ORIG_CLNT_ID=(%s)'
    where table1.col1 is null
    and to substitute the (%s) with data from another table2*. An example is:
    update table1 set col1=
    'LANG_ID=(select LANG_ID from table2* where USER_ID = (select USER_ID from table1))' ||
    '_CHALLENGE_RESPONSE_=((select CHALLENGERESPONSE_ from table2* where USER_id = (select USER_ID from table1)),' ||
    etc for the rest of the values

    I tried this -although the database shows that the affected rows are updated! but querying the table doesn't show the values in the column!
    select col1 from table1 where col1 is null
    shows back the original content (DESPITE it showing me xxx rows updated!)
    UPDATE table1 t1
    SET col1 = (SELECT 'LANG_ID=('||lang_id||')_CHALLENGE_RESPONSE_=('||
    CHALLENGERESPONSE_|| ...*
    FROM table2 t2
    WHERE t1.user_id = t2.user_id)
    WHERE t1.col1 is null;

  • To Select the data from two table one is transp table and onther is cluster

    Hi All,
    I want to select the data from two tables
    Here i am giving with an example.
    Fileds: kunnr belnr from bseg.  table bseg
    fields: adrnr from kna1     table: kna1.
    Know i want to put these into one internal table based on kunnr and belnr.
    Thanks in advance.
    Ramesh

    Hi,
       U cant use joins on cluster table and BSEG is a cluster table so use FOR  ALL ENTRIES for taht
    refer this code
    *&      Form  sub_read_bsak
          text
    -->  p1        text
    <--  p2        text
    FORM sub_read_bsak.
    *--Select data from BSAK Table
      SELECT lifnr
             augdt
             augbl
             gjahr
             belnr
             xblnr
             blart
             dmbtr
             mwskz
             mwsts
             sgtxt
             FROM bsak
             INTO CORRESPONDING FIELDS OF TABLE it_bsak
             WHERE belnr IN s_belnr
             AND   augdt IN s_augdt.
      IF sy-subrc EQ 0.
    *--Sort table by accounting document and vendor number
        SORT it_bsak BY belnr lifnr.
      ENDIF.
    ENDFORM.                    " sub_read_bsak
    *&      Form  sub_read_bseg
          text
    -->  p1        text
    <--  p2        text
    FORM sub_read_bseg.
      IF NOT it_bsak[] IS INITIAL.
    *--Select data from BSEG table
        SELECT belnr
               gjahr
               shkzg
               kostl
               hkont
               ebeln
               ebelp
               FROM bseg
               INTO CORRESPONDING FIELDS OF TABLE it_bseg
               FOR ALL ENTRIES IN it_bsak
               WHERE belnr EQ it_bsak-belnr
               AND   gjahr EQ it_bsak-gjahr
               AND   shkzg EQ 'S'.
        IF sy-subrc EQ 0.
    *--Sort table by accounting document
          SORT it_bseg BY belnr.
        ENDIF.
      ENDIF.
    ENDFORM.                    " sub_read_bseg

  • Substitution Profile is not working correctly

    I have a scenario where a user has to set up substitution to process certain workitems but not all workitems so we have created a substitution profile but it does not seem to be working for us.
    We have configured through IMG the following
    Task class in table T77TC
    Substitution Profile in table T77RP
    We have linked the profile and the class in T77RO
    We have assigned this classification available in additional data to the Task type workflow template through transaction PFTC
    I have created an active substitute for this profile in HRUS_D2 but the other employee does not see any of my workitems. Any help is appreciated.
    Also I have created an active substitute without the profile for another employee and they can see my tasks.
    Thank you very much,
    Susan Thomas

    Hi Susan Thomas
    check the below article and confirm whether all the settings are done as mentioned in the document
    http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/109d2ea2-035c-2c10-06be-f6165ba7af11
    If still you having problem , pls revert
    Regards
    Arumugam

  • TIME-OUT error in BSAK select query(Progress Indicator is also used)

    Hi,
        In my report program one select query is there on BSAK table, which is as follows --
           SELECT BUKRS                                                     
                         BELNR
                        GJAHR
                        SHKZG
                        BSCHL
                        UMSKZ
                        LIFNR
                        EBELN
                        EBELP
                        WRBTR
                        DMBTR
                        XZAHL
                        REBZG
                       AUGBL
                       BLART
                       AUFNR
                       AUGDT
                       BUZEI FROM BSAK
                                  INTO TABLE IT_BSAK
                                  FOR ALL ENTRIES IN IT_BKPF1
                                   WHERE BUKRS = IT_BKPF1-BUKRS
                                                AND AUGDT = IT_BKPF1-BUDAT
                                                AND AUGBL = IT_BKPF1-BELNR
                                                AND BSCHL IN ('31' , '29', '26', '39', '25').
    I used Progress Indicator befor running this query and after this query also. But still It's giving me TIME-OUT error in this select query only.
      I run the same query for 10 records in IT_BKPF1 table, it runs perfectly. But when I run it for 1000 records it giving dump.
    And in actual bussiness my records are always more than 100 only.
    I also check the indexing. It having secondary indexing on this BUKRS, AUGDT, AUGBL fields. Then also it's giving error.
    so, How can I solve this dump..?? What could be the reason..??
    Thanks in advance...!!
    Regards,
    Poonam.

    Hi Poonam Patil,
    Try to provide BELNR and GJAHR in where condition...
    BKPF-DBBLG ==> BSAK-BELNR
    Also check
    BKPF-BLDAT ==> BSAK-AUGDT
    Check out above relation...
    If data is there in these fields of the table and both are matching then you can pass it and as they are in primary key of BSAK it will improve the performance...
    Hope it will solve your problem..
    Thanks & Regards
    ilesh 24x7
    ilesh Nandaniya

  • Tables of Vendor Balances

    Hi All,
    Please let me know the tables of vendor balances. I wanna know the tables from which i could know the balance payments of vendor against PO. Just i wanna know the vendor payment status.
    Regards
    Arun

    arun,
    First all the vendor line items will get stored in BSIK table as a open item, after the line item can be cleared through reversal or by payment to vendor, the system will automatically clear the open tiem and moves the same documents to the BSAK table.
    hope this will be the right answer..
    SRINU

  • In which FI table can I find the triangular deal flag?

    Hi expert,
    I am looking for the FI table in which I can find the triangular deal flag.
    In SD, I can see the documents with traingular deal in table VBAK (field XEGDR), but I don't know in which FI table I can find it.
    Do you have any idea?
    Thank you.
    Kind regards,
    Linda

    Hi,
    You can find the field in BSEG, BSAK tables in FI.
    Regards,
    Praisty

  • HI Gurs, need vendor  / posting / tax table detail

    < MODERATOR:  Message locked.  Please read the [Rules of Engagement|https://www.sdn.sap.com/irj/sdn/wiki?path=/display/home/rulesofEngagement] before posting next time. >
    Anyone know the tables or logical database where I can pick up query vendor / period / doc type and list amount tax, text etc. Points rearded thanks

    Hi,
    You can look at BSIK/BSAK tables for celared and uncleared vendor documents.
    Regards,
    Eli

  • F-22,f-43 tables

    Hi all,
    I need some information regarding “Customer and Vendor Invoices ”
    1.     Can any one please help me what are all the tables that update when we post customer and vendor invoice with F-22 and F-43. please give me all relevant information,. I will be very thank full to you
    2.     Is the same tables That updates when we post invoice in F-22, F-43 and FB60 , FB70. If not please help,
    Thanku.
    mahesh

    Hi Mahesh,
    FB60 and F-43 Both are Vendor invoice posting T.Codes, Vendor open items are stored at BSIK table , Cleared items are BSAK table,
    FB70 and F-22 Both are customer invoice posting T.Codes,
    Customer open items are Stored at BSID Table  and Cleared items are BSAD table,
    It's useful assigen points as way to say thanks.
    Regards
    gvr

  • ! BSAK vs PAYR !

    Hey Folks:
    We have these fields in PAYR table called PRINT DATE and CHECK NUMBER. I am looking for a substitute fields in BSAK (vendor cleared items) for PRINT DATE and CHECK NUMBER.
    Please also let me know if we have substitute for PAYMENT DATE in BSAK table. Does payment date means Posting date or Clearing date??
    Please advice as I am trying to get the payment information from SAP table and generate a interface file for every cleared document (invoice, credit memo’s. etc.).
    Thx
    KK

    KK,
    Both tables will basically give you complimentary data fields, for the same data set.
    For the invoice line item, clearing date is when the payment (run) is made (or the value date of the payment run, if it's different). For the clearing line item (the payment line item), the clearing date is the posting date itself, as it gets cleared the day its posted.
    Payment date is the Clearing Date (taking into account the value date also).
    Clearing Date
    The clearing date specifies as from when the item is to be regarded as cleared. When clearing, the last posting date of all the documents involved in clearing is set as the clearing date.
    Examples
    Invoices which were posted on 10/10/2006 and on 10/15/2006 are cleared by a payment document which is posted on 11/10/2006. In this case the clearing date is 11/10/2006, in other words the posting date of the payment document.
    A rental invoice for December is entered on 11/28/2006 and the posting date is set to 12/01/2006. The rent is paid on 11/30/2006 and is also posted under this date. 12/01/2006 is then set as the clearing date, in other words the posting date of the invoice.
    Now suppose you send out a check payment for the rent for December, with value date as 12/03/2006, then this becomes the Clearing date (for both invoice and payment line items), Posting Date (for payment line item) and also the Payment Date (for the PAYR line item).
    Please note that the clearing date of a line item is never allowed to be before the posting date of the item.
    Regards,
    Gulshan
    P.S.: Please assign points if found useful.

  • Link b/w  BSAK &  AUSP

    Hi gurus,
    is their a link b/w BSAK - Accounting: Secondary Index for Vendors (Cleared Items)
                                AUSP - Characteristic Values ?
    Can i have some info pls..
    thank you,
    pasala.

    Hello,
    One way is you can get the EBELN & EBELP from the BSAK table, put them in EKPO table to get the material (MATNR) & for the same MATNR, you can get the Object ID from MARA.
    Regards,
    Venkata Phani Prasad K

  • Name of tables of fb50 and fb60 and fb70 and fbcj

    hi all
    i make a query from sq01 and it for all  transactions
    io make tranaction in fb50 and fb60 and fb70 and fbcj
    but i need the name of these tables
    tables of documnt header and line items
    tables of vendor header and line items
    tables of customer header and line items
    tables of cash journal  header and line items
    Moderator: Please, search before posting

    Hi,
    please check:
    tables of documnt header and line items: BKPF
    tables of vendor header and line items: BKPF, BSIK and BSAK
    tables of customer header and line items: BKPF: BSID and BSAD
    tables of cash journal header and line items: TCJ_C_JOURNALS, ACCJOURNAL0C, and TCJ_C_JOURNALS
    regards

Maybe you are looking for