Interactve report  on Customer details

hello sdn friends,
i have a question for you.
can u help me how to develop an Interactive report which displays Customer details on basic list,  Sales orders. Items and Materials on secondary lists and when user clicks on any material to switch over   the control to transaction MM02.
from which tables i have to retrieve the data and also relationship between those tables.
i will be happy if any body repled to  me

Hi sreenu,
As per your interactive report,
assuming that you know basics of interactive reports .
first display all the selected customers in basic list and hide the customer id
HIDE is the keyword,
we use sy-lsind for interactive report.
using that customer id you will get the sales orders, items and materials and display them in details list,
GET cursor field Fnam value Fval
SET PARAMETR ID 'MAT' field Fval
call transaction 'MM02' and skip first screen.
*use GET and SET to store the material number
coming to tables ,
customer details in KNA1,sales orders items materials we use VBAK ( i guess , confirm that and use)
hope its clear ,
cheers
kiran

Similar Messages

  • Crystal Reports 2008 Customer Details Aging Report Example / Sample

    Hello!
    Anyone willing to send me a customer details aging report example for SAP Business One? (or give me a link?)
    I've been looking all over and have found examples of things, but not specifically for B1.
    Anything would be useful I am pretty flexible, I just want some bones to work from.  In return I can send you back what I build from it.
    Thanks in advance,
    Mike

    Hi Mike, you might have better  replies if you post your question to the B1 forum. They would be familiar with the B1 functioanlity and data sources.

  • Display customer details one by one in alphabetical order in alv report?

    Hi experts,
    my requirement is ,
    I want to display customer name  and city as  top and then for particular customer's details (like invoice no's,due date, vat.cst etc)
    display in alv grid format,and then next customer name and detals .....etc.(customer name alphabetical order) in single page one by one. Using ALV reports is possible ? pls give me the brief code (or idea).pls give me solution.
    My input is to enter customer numbers so that output(customer details ) is displayed one by one in order.
    I tried but i didn't get if possible pls give me SDN link.

    Ram,
    loop at internaltable.
    I guess you can use AT NEW fieldname event to display the customer name and then call REUSE_ALV_GRID_DISPLAY for every customer to display the corresponding details
    Thanks
    Bala Duvvuri

  • Summary Report using Master-Detail Data on Siebel BI Publisher Report

    I have to create a Summary Report using Master-Detail relationship. Report fields are Account Name, Special Need Type, Customer Status, No of Customers, No of Claims. I am using rtf to create template and any help is highly appreciated
    <?xml version="1.0" encoding="UTF-8" ?>
    - <ListofIO>
    - <ListOfBipCustomerSpecialNeeds>
    - <Account>
    <Name>CVNE</Name>
    - <ListOfContact>
    - <Contact>
    <SpecialNeedsFlg>Y</SpecialNeedsFlg>
    <SpecialNeedsType>Large Text</SpecialNeedsType>
    <PersonUId>1-6NI9</PersonUId>
    - <ListOfContact_Claims>
    - <Contact_Claims>
    <AccountNumber>TEST0015362272</AccountNumber>
    <ClaimNumber>1-4FVL</ClaimNumber>
    <ClaimStatus>Closed</ClaimStatus>
    <ClaimGBPAmount />
    </Contact_Claims>
    </ListOfContact_Claims>
    </Contact>
    - <Contact>
    <SpecialNeedsFlg>Y</SpecialNeedsFlg>
    <SpecialNeedsType>Braille</SpecialNeedsType>
    <PersonUId>1-L0A</PersonUId>
    - <ListOfContact_Claims>
    - <Contact_Claims>
    <AccountNumber />
    <ClaimNumber>1-ACX6</ClaimNumber>
    <ClaimStatus>Open</ClaimStatus>
    <ClaimGBPAmount>818.18196694218</ClaimGBPAmount>
    </Contact_Claims>
    - <Contact_Claims>
    <AccountNumber />
    <ClaimNumber>1-GI58</ClaimNumber>
    <ClaimStatus />
    <ClaimGBPAmount>45454.099173473</ClaimGBPAmount>
    </Contact_Claims>
    </ListOfContact_Claims>
    </Contact>
    - <Contact>
    <SpecialNeedsFlg>Y</SpecialNeedsFlg>
    <SpecialNeedsType>Large Text</SpecialNeedsType>
    <PersonUId>1-6FPP</PersonUId>
    - <ListOfContact_Claims>
    - <Contact_Claims>
    <AccountNumber>CVNE</AccountNumber>
    <ClaimNumber>1-7BRL</ClaimNumber>
    <ClaimStatus>Reviewed</ClaimStatus>
    <ClaimGBPAmount>562</ClaimGBPAmount>
    </Contact_Claims>
    </ListOfContact_Claims>
    </Contact>
    </ListOfContact>
    </Account>
    <Login>SADMIN</Login>
    </ListOfBipCustomerSpecialNeeds>
    </ListofIO>
    Edited by: user2298324 on 13-Aug-2010 09:36

    Thanks for the reply. The many to many relationship between Claims and Payments are achieved through intersection table in siebel. When Customer has multiple claims, single payment issued for both claims. Also single claim can multiple payments such (part compensation, interests, final compensation etc)

  • Report for Customer wise Payment

    Hi All,
    I want a report for Customer who has been maintained on Cash Basis ( One Time Customer). The customer are sold on cash so there is only one entry passed inm FI that is
    Bank A/c Dr
    To Sales A/C Cr
    That means we donot have record customer wise in SAP. But since billing document is created for these customers too, we might be having some report.
    I want if there is any report in SD or FI which can give e cutomer wise payment details
    Thanks in Advance. I am quite liberal in assigning points.
    Rg
    VK

    Hi,
    You can write a custom report to pull the data , say from BSID, BSEC with documnetnumber as key field.
    Hope this helps.
    Thanks,
    Vamsi

  • Zreport for vendor customer details.

    Hi ,
    I have to create a report tto display a vendor and customer details. on screen i have customer code and vendor code with company code and fiscal year. when i select the cust. code plant and year it will show the doc.no ,post. and doc. date,doc type ,qty and amount as per customer details.
    after that as per billing doc. of specific customer ,select excise invoice number and match it with reference number (xblnr) of vendor code. and once it is matched select tht vendor doc.no. post. and doc. date amount and qty and display it in report.so how to right a coding for thesame
    let me know as its urgent.
    Rgrs
    Suchita

    please find below coding for your reference.
    *& Report  ZFI_VEND_CUST_DETAILS
    REPORT  ZFI_VEND_CUST_DETAILS
      NO STANDARD PAGE HEADING
              LINE-COUNT 65
              MESSAGE-ID 00.
    TABLES: BSID,BSIK.
    DATA: IT_BSID LIKE BSID OCCURS 0 WITH HEADER LINE.
    DATA: IT_BSIK LIKE BSIK OCCURS 0 WITH HEADER LINE.
    DATA: IT_J_1IEXCHDR LIKE J_1IEXCHDR OCCURS 0 WITH HEADER LINE.
    DATA: BEGIN  OF IT_OUT OCCURS 0,
            BELNR LIKE BSID-BELNR,        " added On 17.04.2007
            BLDAT LIKE BSID-BLDAT,
            BUDAT LIKE BSID-BUDAT,
            BLART LIKE BSID-BLART,
            NAME  LIKE KNA1-NAME1,                           "Name 1
            MATNR LIKE VBRP-MATNR,    "Material Number
            ARKTX LIKE VBRP-ARKTX,          "Material description
            FKIMG LIKE VBRP-FKIMG,          "Quantity mentioned in the excise invoice
            VBELN LIKE BSID-VBELN,          "Billing Document
            BUKRS LIKE BSID-BUKRS,
           NAME1 LIKE LFA1-NAME1,
            KUNNR LIKE BSID-KUNNR,
            WRBTR LIKE BSID-WRBTR,
            DMBTR LIKE BSID-DMBTR,
            ZUONR LIKE BSID-ZUONR,
           XBLNR LIKE BSID-XBLNR,
           MENGE LIKE VBRP-MENGE,
           LIFNR  LIKE BSIK-LIFNR,        "VENDOR CODE
            EXNUM LIKE J_1IEXCHDR-EXNUM,
            BELNR1 LIKE BSIK-BELNR,        " added On 17.04.2007
            BLDAT1 LIKE BSIK-BLDAT,
            BUDAT1 LIKE BSIK-BUDAT,
           BLART LIKE BSID-BLART,
           NAME  LIKE KNA1-NAME1,                           "Name 1
           MATNR LIKE VBRP-MATNR,    "Material Number
           ARKTX LIKE VBRP-ARKTX,          "Material description
           FKIMG1 LIKE VBRP-FKIMG,          "Quantity mentioned in the excise invoice
           VBELN LIKE BSID-VBELN,          "Billing Document
           BUKRS LIKE BSID-BUKRS,
            NAME1 LIKE LFA1-NAME1,
           KUNNR LIKE BSID-KUNNR,
           WRBTR LIKE BSID-WRBTR,
            DMBTR1 LIKE BSIK-DMBTR,
           ZUONR LIKE BSID-ZUONR,
            XBLNR LIKE BSIK-XBLNR,
           MENGE LIKE VBRP-MENGE,
            LIFNR  LIKE BSIK-LIFNR,
            END OF IT_OUT.
    *DATA: IT_OUT1 LIKE IT_OUT OCCURS 0 WITH HEADER LINE.
    *ALV VARIABLES AND INTERNAL TABLES
    TYPE-POOLS: SLIS.
    DATA: IS_LAYOUT     TYPE SLIS_LAYOUT_ALV,
          IT_FIELDCAT   TYPE SLIS_T_FIELDCAT_ALV,
          IT_LISTHEADER TYPE SLIS_T_LISTHEADER,
          IT_EVENTS     TYPE SLIS_T_EVENT,
          IT_PRINT      TYPE SLIS_PRINT_ALV OCCURS 1 WITH HEADER LINE.
    *SELECTION SCREEN DEFINITIONS
    SELECTION-SCREEN BEGIN OF BLOCK B WITH FRAME TITLE TEXT-001.
    SELECT-OPTIONS : SO_KUNNR FOR   BSID-KUNNR,
                     SO_LIFNR FOR   BSIK-LIFNR,
                     SO_BLART FOR   BSID-BLART.
    PARAMETER      : P_BUKRS LIKE   BSID-BUKRS OBLIGATORY,
                     P_GJAHR LIKE   BSID-GJAHR OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK B.
    *START-OF-SELECTION
    START-OF-SELECTION.
      PERFORM GET_DATA.
      PERFORM DISPLAY_DATA.
    *&      Form  GET_DATA
          text
    -->  p1        text
    <--  p2        text
    form GET_DATA .
    SELECT * FROM BSID
    INTO TABLE IT_BSID
    WHERE KUNNR IN SO_KUNNR AND
    BUKRS = P_BUKRS AND
    GJAHR = P_GJAHR.
    LOOP AT IT_BSID.
    IT_OUT-BELNR = IT_BSID-BELNR.
    IT_OUT-BUKRS = IT_BSID-BUKRS.
    IT_OUT-KUNNR = IT_BSID-KUNNR.
    IT_OUT-ZUONR = IT_BSID-ZUONR.
    IT_OUT-DMBTR = IT_BSID-DMBTR.
    IT_OUT-VBELN = IT_BSID-VBELN.
    IT_OUT-XBLNR = IT_BSID-XBLNR.
    IT_OUT-BLART = IT_BSID-BLART.
    IT_OUT-BUDAT = IT_BSID-BUDAT.
    IT_OUT-BLDAT = IT_BSID-BLDAT.
    APPEND IT_OUT.
    ENDLOOP.
    *SELECT * FROM J_1IEXCHDR
    *INTO IT_J_1IEXCHDR
    *WHERE RDOC = IT_OUT-VBELN.
    *LOOP AT IT_J_1IEXCHDR.
    IT_OUT-EXNUM = IT_J_1IEXCHDR-EXNUM.
    **ENDLOOP.
    *SELECT * FROM BSIK
    *INTO TABLE IT_BSIK
    *WHERE XBLNR = IT_OUT-EXNUM AND
    *LIFNR IN SO_LIFNR AND
    *BUKRS = P_BUKRS AND
    *GJAHR = P_GJAHR.
    *LOOP AT IT_BSIK.
    *IT_OUT-BELNR1 = IT_BSIK-BELNR.
    **IT_OUT-BUKRS = IT_BSIK-BUKRS.
    *IT_OUT-LIFNR = IT_BSIK-LIFNR.
    **IT_OUT-ZUONR = IT_BSIK-ZUONR.
    *IT_OUT-DMBTR1 = IT_BSIK-DMBTR.
    *IT_OUT-XBLNR = IT_BSIK-XBLNR.
    **IT_OUT-BLART = IT_BSIK-BLART.
    *IT_OUT-BUDAT1 = IT_BSIK-BUDAT.
    *IT_OUT-BLDAT1 = IT_BSIK-BLDAT.
    *APPEND IT_OUT.
    *ENDLOOP.
    *ENDLOOP.
    *ENDSELECT.
    *SORT IT_OUT BY KUNNR.
    LOOP AT IT_OUT.
    SELECT SINGLE EXNUM FROM J_1IEXCHDR
    INTO IT_OUT-EXNUM
    WHERE RDOC = IT_OUT-VBELN.
    SELECT BELNR LIFNR DMBTR XBLNR BUDAT BLDAT
    FROM BSIK INTO (IT_OUT-BELNR1,IT_OUT-LIFNR,IT_OUT-DMBTR1,IT_OUT-XBLNR,IT_OUT-BUDAT1,IT_OUT-BLDAT1)
    WHERE XBLNR = IT_OUT-EXNUM.
    ENDSELECT.
    SELECT SINGLE NAME1            "NAME OF CUSTOMER
               FROM KNA1
               INTO IT_OUT-NAME
               WHERE KUNNR = IT_OUT-KUNNR.
    SELECT SINGLE NAME1            "NAME OF VENDOR
                   FROM LFA1
                   INTO IT_OUT-NAME1
                   WHERE LIFNR = IT_OUT-LIFNR.
    SELECT MATNR ARKTX FKIMG
               FROM VBRP
               INTO (IT_OUT-MATNR,IT_OUT-ARKTX,IT_OUT-FKIMG)
               WHERE VBELN = IT_OUT-VBELN AND
                     WERKS = P_BUKRS.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
      EXPORTING
        input         = IT_OUT-MATNR
    IMPORTING
       OUTPUT        = IT_OUT-MATNR.
    MODIFY IT_OUT.
    CLEAR IT_OUT.
    ENDSELECT.
    ENDLOOP.
    endform.                    " GET_DATA
    *&      Form  DISPLAY_DATA
          text
    -->  p1        text
    <--  p2        text
    form DISPLAY_DATA .
      PERFORM FILL_LAYOUT_STRUCTURE.
      PERFORM ALV_HEADER USING IT_LISTHEADER.
      PERFORM FILL_FIELDCAT USING :
          'BLDAT'    'DOC Date'             10  'IT_OUT'  SPACE SPACE,
          'BUDAT'    'Post.Date'            10  'IT_OUT'  SPACE SPACE,
          'KUNNR'    'Customer Code'        10  'IT_OUT'  SPACE SPACE,
          'NAME'     'Customer Name'        35  'IT_OUT'  SPACE SPACE,
          'LIFNR'    'VENDOR CODE'          10  'IT_OUT'  SPACE SPACE,
          'NAME1'    'VENDOR DESC'          35  'IT_OUT'  SPACE SPACE,
          'BLART'    'Doc. Type'             2  'IT_OUT'  SPACE SPACE,
          'VBELN'    'BILLING DOC NO.'      10  'IT_OUT'  SPACE SPACE,
          'BELNR'    'Account Doc. No.'     10  'IT_OUT'  SPACE SPACE,
          'DMBTR'    'AMOUNT IN LOCAL'      13  'IT_OUT'  SPACE SPACE,
          'MATNR'    'Material Code'        10  'IT_OUT'  SPACE SPACE,
          'ARKTX'    'Material DESC'        35  'IT_OUT'  SPACE SPACE,
          'FKIMG'    'QTY'                  12  'IT_OUT'  SPACE SPACE,
          'ZUONR'    'ASSIGNNMENT'          18  'IT_OUT'  SPACE SPACE,
          'EXNUM'    'Excise inv no.'       13  'IT_OUT'  SPACE SPACE,
          'BELNR1'   'Account Doc. No.'     10  'IT_OUT'  SPACE SPACE,
          'BLDAT1'   'DOC Date'             10  'IT_OUT'  SPACE SPACE,
          'BUDAT1'   'Post.Date'            10  'IT_OUT'  SPACE SPACE,
          'DMBTR1'   'AMOUNT IN LOCAL'      13  'IT_OUT'  SPACE SPACE,
          'XBLNR'    'REFERENCE DOC'        10  'IT_OUT'  SPACE SPACE.
    PERFORM ALV_EVENTS USING IT_EVENTS.
    PERFORM ALV_PRINT.
      PERFORM ALV_DISPLAY.
    endform.                    " DISPLAY_DATA
    *&      Form  FILL_LAYOUT_STRUCTURE
          text
    -->  p1        text
    <--  p2        text
    form FILL_LAYOUT_STRUCTURE .
    DATA: WA_EVENT       TYPE SLIS_ALV_EVENT,
            WA_LISTHEADER  TYPE SLIS_T_LISTHEADER.
      CLEAR IS_LAYOUT.
      IS_LAYOUT-ZEBRA = 'X'.
         is_layout-F2CODE = '&ETA'.
         is_layout-detail_popup = 'X'.
      IS_LAYOUT-INFO_FIELDNAME = 'COL_LINE'.
    endform.                    " FILL_LAYOUT_STRUCTURE
    *&      Form  FILL_FIELDCAT
          text
         -->P_0606   text
         -->P_0607   text
         -->P_10     text
         -->P_0609   text
         -->P_SPACE  text
         -->P_SPACE  text
    form FILL_FIELDCAT  using    F D O T TO P.
      DATA WA_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
      STATICS POS LIKE SY-INDEX VALUE 1.
      POS = POS + 1.
      CLEAR WA_FIELDCAT.
      MOVE : 1     TO   WA_FIELDCAT-ROW_POS,
             POS   TO   WA_FIELDCAT-COL_POS,
             F     TO   WA_FIELDCAT-FIELDNAME,
             D     TO   WA_FIELDCAT-SELTEXT_L,
             O     TO   WA_FIELDCAT-OUTPUTLEN,
             T     TO   WA_FIELDCAT-TABNAME,
             TO    TO   WA_FIELDCAT-DO_SUM,
             P     TO   WA_FIELDCAT-FIX_COLUMN.
      APPEND WA_FIELDCAT TO IT_FIELDCAT.
    endform.                    " FILL_FIELDCAT
    FORM ALV_EVENTS USING EVENTS TYPE SLIS_T_EVENT.
      DATA : WA_EVENTS TYPE SLIS_ALV_EVENT.
      CLEAR WA_EVENTS.
      WA_EVENTS-NAME = 'TOP_OF_PAGE'(001).
      WA_EVENTS-FORM = 'TOP_OF_PAGE'.
      APPEND WA_EVENTS TO IT_EVENTS.
    ENDFORM.                    "alv_events
    *&      Form  ALV_DISPLAY
          text
    -->  p1        text
    <--  p2        text
    form ALV_DISPLAY .
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
      I_INTERFACE_CHECK                 = ' '
      I_BYPASSING_BUFFER                = ' '
      I_BUFFER_ACTIVE                   = ' '
         I_CALLBACK_PROGRAM                = SY-REPID
      I_CALLBACK_PF_STATUS_SET          = ' '
         I_CALLBACK_USER_COMMAND           = 'CALL_TCODE'
         I_CALLBACK_TOP_OF_PAGE            = 'TOP_OF_PAGE'
      I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
      I_CALLBACK_HTML_END_OF_LIST       = ' '
      I_STRUCTURE_NAME                  =
      I_BACKGROUND_ID                   = ' '
      I_GRID_TITLE                      =
      I_GRID_SETTINGS                   =
         IS_LAYOUT                         = IS_LAYOUT
         IT_FIELDCAT                       = IT_FIELDCAT
      IT_EXCLUDING                      =
      IT_SPECIAL_GROUPS                 =
       IT_SORT                           = i_sort[]
      IT_FILTER                         =
      IS_SEL_HIDE                       =
         I_DEFAULT                         = 'X'
         I_SAVE                            = 'A'
      IS_VARIANT                        =
         IT_EVENTS                         = IT_EVENTS
      IT_EVENT_EXIT                     =
         IS_PRINT                          = IT_PRINT
      IS_REPREP_ID                      =
      I_SCREEN_START_COLUMN             = 0
      I_SCREEN_START_LINE               = 0
      I_SCREEN_END_COLUMN               = 0
      I_SCREEN_END_LINE                 = 0
      I_HTML_HEIGHT_TOP                 = 0
      I_HTML_HEIGHT_END                 = 0
      IT_ALV_GRAPHICS                   =
      IT_HYPERLINK                      =
      IT_ADD_FIELDCAT                   =
      IT_EXCEPT_QINFO                   =
      IR_SALV_FULLSCREEN_ADAPTER        =
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER           =
      ES_EXIT_CAUSED_BY_USER            =
       TABLES
          T_OUTTAB                          = IT_OUT
       EXCEPTIONS
         PROGRAM_ERROR                     = 1
         OTHERS                            = 2
      IF SY-SUBRC <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    endform.                    " ALV_DISPLAY
    *FORM FOR TOP OF PAGE
    FORM TOP_OF_PAGE.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          IT_LIST_COMMENTARY = IT_LISTHEADER.
    ENDFORM.                    "top_of_page
    *&      Form  alv_header
    FORM alv_header  USING    P_IT_LISTHEADER.
      data : wa_listheader  type slis_listheader.
      data : v_date1(10).
      data : v_date2(10).
      data : v_kunnr1 LIKE bsid-kunnr.
      data : v_kunnr2 LIKE bsid-kunnr.
      data : v_name1 like t001w-name1.
      clear wa_listheader.
      wa_listheader-typ = 'H'.
      move  'DETAILED CUSTOMER VENDOR DETAILS'
      to  wa_listheader-info.
      append wa_listheader to it_listheader.
    select single name1
         from t001w
         into v_name1
         where werks = p_bukrs.
    clear wa_listheader.
    wa_listheader-typ = 'S'.
    wa_listheader-key = 'Plant'.
    move v_name1
    to wa_listheader-info.
    append wa_listheader to it_listheader.
    write so_budat-low  to v_date1  dd/mm/yyyy no-gap.
    write so_budat-high to v_date2  dd/mm/yyyy no-gap.
    if so_budat-low is not initial and so_budat-high is not initial.
       clear wa_listheader.
       wa_listheader-typ = 'S'.
       wa_listheader-key = 'Date '.
       concatenate v_date1 ' To ' v_date2 into
                           wa_listheader-info separated by space.
       wa_listheader-info = wa_listheader-info.
       append wa_listheader to it_listheader.
    elseif  so_budat-low is initial and so_budat-high is initial.
       clear wa_listheader.
       wa_listheader-typ = 'S'.
       wa_listheader-key = 'Date '.
       wa_listheader-info = '*'.
       append wa_listheader to it_listheader.
    elseif so_budat-high is initial.
       clear wa_listheader.
       wa_listheader-typ = 'S'.
       wa_listheader-key = 'Date '.
       wa_listheader-info = v_date1.
       append wa_listheader to it_listheader.
    endif.
    v_kunnr1 = so_kunnr-low.
    v_kunnr2 = so_kunnr-high.
    if so_kunnr-low is not initial and so_kunnr-high is not initial.
       clear wa_listheader.
       wa_listheader-typ = 'S'.
       wa_listheader-key = 'Customer '.
       concatenate v_kunnr1 ' To ' v_kunnr2 into
                           wa_listheader-info separated by space.
       wa_listheader-info = wa_listheader-info.
       append wa_listheader to it_listheader.
    elseif  so_kunnr-low is initial and so_kunnr-high is initial.
       clear wa_listheader.
       wa_listheader-typ = 'S'.
       wa_listheader-key = 'Customer '.
       wa_listheader-info = '*'.
       append wa_listheader to it_listheader.
    elseif so_kunnr-high is initial.
       clear wa_listheader.
       wa_listheader-typ = 'S'.
       wa_listheader-key = 'Customer '.
       wa_listheader-info = v_kunnr1.
       append wa_listheader to it_listheader.
    endif.
    ENDFORM.                    " alv_header.
    waiting for ur reply.
    Thanx
    Suchita

  • To update vendor and customer details in BP transaction

    I have created a donor in the BP transaction . i need to update the vendor and customer details for the reated donor.
    please can someone suggest some BAPI's or FM's which are available to do the same.

    Hello Om,
    You can get vendor/costumer number and their names in FBL3N when you get bank ledger's line item.
    You must use BTE functions.
    I don't your techinal skills about SAP but if you don't know ABAP or ABAP dictionary details, you can get help your ABAPer.
    I will explain step by step.
    First of all, if you don't use BTE before, You must create a product on FIBF.
    Call FIBF transaction -> Settings -> Products -> ...of a customer
    Create a new line,
    Product : ZFI
    Text : BTE Products for FI Exit
    Product active : tick check fro activation.
    Then you must call SE11 for structure RFPOS.
    You must use append structure function for this structure and you can define ZFI_RFPOS append structure.
    Define 4 fields.
    Component : KUNNR - Component type : KUNNR
    Component : NAMED - Component type : NAME1
    Component : LIFNR - Component type : LINFR
    Component : NAMEK - Component type : NAME1
    Then save and active your RFPOS structure.
    After that, you must do same step for structure RFPOSX.
    Then go to SE37 and copy from SAMPLE_INTERFACE_00001650 to ZFI_INTERFACE_00001650 FM.
    After copy action, you must uncomment this line on ZFI_INTERFACE_00001650 FM's source code. It's very very important;
    E_POSTAB = I_POSTAB.
    Then you should add some ABAP code for getting customer & vendor details.
    I give you some examples, you can use it. (next message on this thread, please check)
    Then save and active FM.
    Call FIBF transaction again.
    FIBF -> Settings -> Process Modules -> ...of a customer
    Define a new line.
    Process : 00001650
    Function Module : ZFI_INTERFACE_00001650
    Product : ZFI
    and this customizing.
    Then you go to SE38 transaction.
    start report RFPOSXEXTEND. After starting, a pop-up appears, you must click YES.
    After those operations, you can see customer/vendor code and their names on FBL3N.
    I hope it helps to you.
    Regards,
    Burak.

  • Standard Report for Customer Listing

    Hi Gurus
    Is there any standard report available for Customer listing which display customer details.
    Points will be rewarded..
    Regards
    Happy

    Hey Happy,
    I think there is no standard report functionality to get the list of the customer but you can get that in this way,
    Go to SE16 transaction enter the table KNVV then execute system will give the all customer which are maintaining sales area data.
    Take the table KNA1 to get the general data customers list
    Take the table KNB1 to the company code data customers list
    I hope it will help you
    Regards,
    Murali.

  • SC Report for Confirmation Details

    Hi All
    We are in SRM 7 EHP 2.
    We are doing Confirmations in SRM Portal only
    We have a requirement to create as Custom Report for Confirmation Details with below fields.
    1. Company Code
    2, Purchasing Organization
    3. Account Assignment
    4. Confirmation Name
    5. Status
    6. Requester
    7. PO Number
    How can I do it, Please advice
    Thanks
    Ajit

    Hi Ajit,
    Explore the possibility of achieving this with a new POWL query?
    Use the existing POWL in the confirmation screen as a starting point to see what can be modified to suit your requirement.
    - Sai.

  • Cutom T-Code for seding customer details thru IDoc Debmas

    Hi Experts,
    I have a requirment where in.. I need to send customer details thru IDoc from a custom screen which has cutomer text box and a submit button. After entering cutomer and clicking on submit debmas06 Idoc has to be triggered.
    I am not an ABAP expert... please help me with process on devloping the above reqirment.
    This is a critical requirment please help ASAP.
    Thanks,
    Suma

    Hi,
    u have to use standalone program..iam giving one sample code..aong with u have define the RFC (SM59,WE21(Create port),WE20(create partner profile,BD64 distribute model view)...u have to do..
    when u press on submit button,,,
    *& Report ZZ_Program_To_Create_Idoc
    report zz_program_to_create_idoc .
    tables: ekko,ekpo.
    selection-screen skip 3.
    selection-screen begin of block b1 with frame title titl.
    selection-screen skip.
    select-options s_ebeln for ekko-ebeln.
    selection-screen skip.
    selection-screen end of block b1.
    data: header_segment_name like edidd-segnam value 'Z1EKKO',
    item_segment_name like edidd-segnam value 'Z1EKPO',
    idoc_name like edidc-idoctp value 'Z19838IDOC1'.
    data: header_segment_data like z1ekko,
    item_segment_data like z1ekpo.
    data: control_record like edidc.
    data: messagetyp like edmsg-msgtyp value 'ZZ9838MESG1'.
    data: i_communication like edidc occurs 0 with header line,
    i_data like edidd occurs 0 with header line.
    data: begin of i_ekko occurs 0,
    ebeln like ekko-ebeln,
    aedat like ekko-aedat,
    bukrs like ekko-bukrs,
    bsart like ekko-bsart,
    lifnr like ekko-lifnr,
    end of i_ekko.
    data: begin of i_ekpo occurs 0,
    ebelp like ekpo-ebelp,
    matnr like ekpo-matnr,
    menge like ekpo-menge,
    meins like ekpo-meins,
    netpr like ekpo-netpr,
    end of i_ekpo.
    start-of-selection.
    select ebeln aedat bukrs bsart lifnr from ekko
    into table i_ekko where ebeln in s_ebeln.
    select ebelp
    matnr
    menge
    meins
    netpr
    from ekpo
    into table i_ekpo
    where ebeln in s_ebeln.
    control_record-mestyp = messagetyp.
    control_record-rcvprt = 'LS'.
    control_record-idoctp = idoc_name.
    control_record-rcvprn = '0MART800'.
    loop at i_ekko.
    header_segment_data-ebeln = i_ekko-ebeln.
    header_segment_data-aedat = i_ekko-aedat.
    header_segment_data-bukrs = i_ekko-bukrs.
    header_segment_data-bsart = i_ekko-bsart.
    header_segment_data-lifnr = i_ekko-lifnr.
    i_data-segnam = header_segment_name.
    i_data-sdata = header_segment_data.
    append i_data.
    select ebelp
    matnr
    menge
    meins
    netpr
    from ekpo
    into table i_ekpo
    where ebeln = i_ekko-ebeln.
    loop at i_ekpo.
    item_segment_data-ebelp = i_ekpo-ebelp.
    item_segment_data-matnr = i_ekpo-matnr.
    item_segment_data-menge = i_ekpo-menge.
    item_segment_data-meins = i_ekpo-meins.
    item_segment_data-netpr = i_ekpo-netpr.
    i_data-segnam = item_segment_name.
    i_data-sdata = item_segment_data.
    append i_data.
    endloop.
    clear i_ekpo.
    refresh i_ekpo.
    endloop.
    call function 'MASTER_IDOC_DISTRIBUTE'
    exporting
    master_idoc_control = control_record
    OBJ_TYPE = ''
    CHNUM = ''
    tables
    communication_idoc_control = i_communication
    master_idoc_data = i_data
    exceptions
    error_in_idoc_control = 1
    error_writing_idoc_status = 2
    error_in_idoc_data = 3
    sending_logical_system_unknown = 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.
    else.
    loop at i_communication.
    write: 'IDOC GENERATED', i_communication-docnum.
    endloop.
    commit work.
    endif.
    initialization.
    titl = 'ENTER THE PURCHASE ORDER NUMBER'.
    Regards,
    Nagaraj

  • Data Ownership for Reports - ex Customer ageing

    When we run Customer Ageing. The Ageing details for the customer belonging to the Sales employee to be shown.
    Currently shows all the customers.
    Ex - Customer 1,2,3 belong to Sales employee A
           Customer 4,5,6 belong to Sales Employee B
    Now when I run Customer ageing, Sales Employee A should see only the Ageing report for Customer 1,2,3
    and Sales Employee B should see the ageing report for Customer 4,5,6.
    Is this possible to establish through Data Ownership.
    Regards,
    Sid

    I believe it may not be achievable just by built-in data ownership authorization.  That is because authorization mostly only block updating.  You probably need SDK to get solution.
    Thanks,
    Gordon

  • QLD -query based customised report for customer aging

    Hello Expert,
    I want to write a query for the QLD  and this report is a customised report for customer statement-aging
    Requirements
    1. The QLD report  query should have selection criteria Posting date range[user must input]
    2. The QLD report  query should have also another selection critreria Customer code[If user input it then report must display details for only that particular customer, if it is blank i mean not inputed by user then this report should display details of all customers with page break., I mean start with first customer.. show details and page break  start second customer show all details  and so on
    Let us sec the QLD details                                                                               
    at the header Level customer detals name/address/balances(3429.4) etc
    Code|| Name||Doc Type || Doc number||Posting date||Debt Amount||Credit Amount||
    C00001  || ABC LtdII AR Inv     || 12/01/2011||12000|| 0
    C00001  || ABC Ltd|| AR Memo|| 12/15/2011||0        || 5600
    C00001  || ABC Ltd|| Incoming || 12/15/2011||0        || 4000
    C00001  || ABC Ltd|| OTHER   || 12/20/2011||1000  || 0
    Summary
    Balance||        0-30         ||  31-60         || 61-90||          91-120          || 121+
    3429.4     3400     200     300     -300     -170.6
    100%     99.14%     5.88%     8.75%     -8.75%     -5%
    Page Break
    at the header Level customer detals name/address/balances(969.4) etc
    Code|| Name||Doc Type || Doc number||Posting date||Debt Amount||Credit Amount||
    C00002  || ABC LtdII AR Inv     || 12/01/2011||15000|| 0
    C00002  || ABC Ltd|| AR Memo|| 12/15/2011||0        || 3600
    C00002  || ABC Ltd|| Incoming || 12/15/2011||0        || 3000
    C00002  || ABC Ltd|| OTHER   || 12/20/2011||5000  || 0
    Summary
    Balance||        0-30         ||  31-60         || 61-90||          91-120          || 121+
    969.4     1440     500     -500     -300     -170.6
    100%     148.55%     51.58%     -51.58%     -30.95%     17.6%
    and so on
    Note #1 If the balances for a customer is zero then I should not be the part of the report
    Note #2 In the existing report system is showing summary  details only for the date range , but here I am looking for all dates
    Thanks
    Arun K Singh

    Hi Arun,
    Try this...
    SELECT T1.CardCode, T1.CardName, T1.CreditLine, T0.RefDate, T0.Ref1 'Document Number',
         CASE  WHEN T0.TransType=13 THEN 'Invoice'
              WHEN T0.TransType=14 THEN 'Credit Note'
              WHEN T0.TransType=30 THEN 'Journal'
              WHEN T0.TransType=24 THEN 'Receipt'
              END AS 'Document Type',
         T0.DueDate, (T0.Debit- T0.Credit) 'Balance'
         ,ISNULL((SELECT T0.Debit-T0.Credit WHERE DateDiff(day, T0.DueDate,'[%1]')<=-1),0) 'Future'
         ,ISNULL((SELECT T0.Debit-T0.Credit WHERE DateDiff(day, T0.DueDate,'[%1]')>=0 and DateDiff(day, T0.DueDate,'[%1]')<=30),0) 'Current'
         ,ISNULL((SELECT T0.Debit-T0.Credit WHERE DateDiff(day, T0.DueDate,'[%1]')>30 and DateDiff(day, T0.DueDate,'[%1]')<=60),0) '31-60 Days'
         ,ISNULL((SELECT T0.Debit-T0.Credit WHERE DateDiff(day, T0.DueDate,'[%1]')>60 and DateDiff(day, T0.DueDate,'[%1]')<=90),0) '61-90 Days'
         ,ISNULL((SELECT T0.Debit-T0.Credit WHERE DateDiff(day, T0.DueDate,'[%1]')>90 and DateDiff(day, T0.DueDate,'[%1]')<=120),0) '91-120 Days'
         ,ISNULL((SELECT T0.Debit-T0.Credit WHERE DateDiff(day, T0.DueDate,'[%1]')>=121),0) '121+ Days'
    FROM JDT1 T0 INNER JOIN OCRD T1 ON T0.ShortName = T1.CardCode
    WHERE (t0.BalDueCred !=0 or T0.BalDueDeb != 0) AND T0.RefDate <= [%1] AND T1.CardType = 'C' and T0.TransType in ('13','14','30','24')
    ORDER BY T1.CardCode, T0.DueDate, T0.Ref1
    Thanks,
    Srujal Patel

  • Enhancement request for VAT Report of Customer and Vendor.

    Hello SAP Gurus,
    Have enhancement request for adding new fields in existing VAT report of Customer and Vendor like user id, GL account etc.
    As I am fresher, can you please help me that how I need to approach. Thanks for your support.
    Regards,
    Saleem

    Hello Saleem,
    Almost all fields required for VAT reporting are available in standard tax report
    S_ALR_87012357 .
    You have to configure the layout from the selection screen as below
    regards
    pb

  • Alv Report for invoice details

    Dear All,
                 I need to develop one alv report for following details. i developed coding for this requirment but i am getting some error.kindley help me to how to move data from different internal table to final internal table. I used LOOP AT and READ Statement even i didn't get any output.
    kindley help me out.
    TYPES: BEGIN OF XT_TAB,
             LIFNR  LIKE LFA1-LIFNR,
             NAME1  LIKE LFA1-NAME1,
             STCD1  LIKE LFA1-STCD1,
             STCD2  LIKE LFA1-STCD2,
             STCD3  LIKE LFA1-STCD3,
             STCD4  LIKE LFA1-STCD4,
           END OF XT_TAB.
    TYPES: BEGIN OF YT_TAB,
            BUKRS LIKE BSEG-BUKRS,
            BELNR LIKE BSEG-BELNR,
            BUZEI LIKE BSEG-BUZEI,
            LIFNR LIKE BSEG-LIFNR,
            GJAHR LIKE BSEG-GJAHR,
           END OF YT_TAB.
    TYPES: BEGIN OF ZT_TAB,
            LIFNR  LIKE LFA1-LIFNR,
            NAME1  LIKE LFA1-NAME1,
            STCD2  LIKE LFA1-STCD2,
            BELNR  LIKE BSEG-BELNR,
            BUZEI  LIKE BSEG-BUZEI,
            GJAHR  LIKE BSEG-GJAHR,
           END OF ZT_TAB.
           I N T E R N A L   T A B L E   D E C L A R A T I O N S         *
    *-----Internal table to store data
    DATA: ITAB1   TYPE STANDARD TABLE OF XT_TAB INITIAL SIZE 0,
          WA_TAB1 TYPE XT_TAB.
    DATA: ITAB2   TYPE STANDARD TABLE OF YT_TAB INITIAL SIZE 0,
          WA_TAB2 TYPE YT_TAB.
    DATA:   ITAB  TYPE STANDARD TABLE OF  ZT_TAB  WITH HEADER LINE,
            WA_ITAB TYPE ZT_TAB,
            ITAB_FINAL2 TYPE STANDARD TABLE OF ZT_TAB.
    DATA: ITAB_TEMP1 TYPE STANDARD TABLE OF ZT_TAB  WITH HEADER LINE.
                    Selection Screen Declarations                        *
    SELECTION-SCREEN BEGIN OF BLOCK bk1 WITH FRAME TITLE text-001.
    SELECTION-SCREEN SKIP.
    SELECTION-SCREEN begin OF LINE.
    SELECTION-SCREEN COMMENT (23) text-003 FOR FIELD P_LIFNR.
    PARAMETERS P_LIFNR LIKE LFA1-LIFNR OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN SKIP.
    SELECTION-SCREEN END OF BLOCK bk1.
    START-OF-SELECTION.
          PERFORM XTRACT_DATA.
    END-OF-SELECTION.
    *-----Filling the Output table
      PERFORM populate_main_table.
          PERFORM BUILD_FIELDCATALOG.
         PERFORM SORTING.
          PERFORM BUILD_LAYOUT.
          PERFORM BUILD_ALV_GRID_DISPLAY.
         Form  XTRACT_DATA
    FORM XTRACT_DATA .
    *SELECT
          a~LIFNR
          a~NAME1
          a~STCD2
          b~BELNR
          b~BUZEI
          b~GJAHR
    INTO TABLE ITAB
    FROM LFA1 as a INNER JOIN BSEG as b
      ON  aLIFNR = bLIFNR
    WHERE  a~LIFNR = P_LIFNR.
    SELECT LIFNR
           NAME1
           STCD1
           STCD2
           STCD3
           STCD4
      FROM LFA1
      INTO TABLE ITAB1
      WHERE LIFNR = P_LIFNR.
    IF NOT ITAB1[] IS INITIAL.
        SORT ITAB1 BY LIFNR.
        SELECT BELNR
               BUZEI
               LIFNR
               GJAHR
    INTO TABLE ITAB2
          FROM BSEG
    FOR ALL ENTRIES IN ITAB1
    WHERE LIFNR = ITAB1-LIFNR.
    ENDIF.
    ENDFORM.                    " XTRACT_DATA
    *&      Form  POPULATE_MAIN_TABLE
          text
    -->  p1        text
    <--  p2        text
    FORM POPULATE_MAIN_TABLE .
       LOOP AT ITAB1 INTO WA_TAB1.
               ITAB-LIFNR = ITAB1-LIFNR.
               ITAB-NAME1 = ITAB1-NAME1.
               ITAB-STCD2 = ITAB1-STCD2.
       READ TABLE ITAB2 INTO WA_TAB2 WITH KEY LIFNR = WA_TAB1-LIFNR.
               IF sy-subrc = 0.
               ITAB-BELNR = ITAB1-BELNR.
               ITAB-BUZEI = ITAB1-BUZEI.
               ITAB-GJAHR = ITAB1-GJAHR.
               ENDIF.
      ENDLOOP.
      ENDFORM.                    " POPULATE_MAIN_TABLE
         Form  BUILD_FIELDCATALOG
    FORM BUILD_FIELDCATALOG .
      REFRESH t_fcat.
      CLEAR t_fcat.
      wa_fcat-col_pos = 1.
      wa_fcat-row_pos = 1.
      wa_fcat-seltext_s = 'Vendor Number'.
      wa_fcat-seltext_m = 'Vendor Number'.
      wa_fcat-seltext_l = 'Vendor Number'.
      wa_fcat-fieldname = 'LIFNR'.
      wa_fcat-tabname = 'ITAB'.
      APPEND wa_fcat TO t_fcat.
      CLEAR t_fcat.
      wa_fcat-col_pos = 2.
      wa_fcat-row_pos = 1.
      wa_fcat-seltext_s = 'Vendor Name'.
      wa_fcat-seltext_m = 'Vendor Name'.
      wa_fcat-seltext_l = 'Vendor Name'.
      wa_fcat-fieldname = 'NAME1'.
      wa_fcat-tabname = 'ITAB'.
      APPEND wa_fcat TO t_fcat.
      CLEAR t_fcat.
      wa_fcat-col_pos = 3.
      wa_fcat-row_pos = 1.
      wa_fcat-seltext_s = 'Vendor TIN Number'.
      wa_fcat-seltext_m = 'Vendor TIN Number'.
      wa_fcat-seltext_l = 'Vendor TIN Number'.
      wa_fcat-fieldname = 'STCD2'.
      wa_fcat-tabname = 'ITAB'.
      APPEND wa_fcat TO t_fcat.
      CLEAR t_fcat.
      wa_fcat-col_pos = 4.
      wa_fcat-row_pos = 1.
      wa_fcat-seltext_s = 'Document No'.
      wa_fcat-seltext_m = 'Document No'.
      wa_fcat-seltext_l = 'Document No'.
      wa_fcat-fieldname = 'BELNR'.
      wa_fcat-tabname = 'ITAB'.
      APPEND wa_fcat TO t_fcat.
      CLEAR t_fcat.
      wa_fcat-col_pos = 5.
      wa_fcat-row_pos = 1.
      wa_fcat-seltext_s = 'Item Number'.
      wa_fcat-seltext_m = 'Item Number'.
      wa_fcat-seltext_l = 'Item Number'.
      wa_fcat-fieldname = 'BUZEI'.
      wa_fcat-tabname = 'ITAB'.
      APPEND wa_fcat TO t_fcat.
      CLEAR t_fcat.
      wa_fcat-col_pos = 6.
      wa_fcat-row_pos = 1.
      wa_fcat-seltext_s = 'Fiscal Year'.
      wa_fcat-seltext_m = 'Fiscal Year'.
      wa_fcat-seltext_l = 'Fiscal Year'.
      wa_fcat-fieldname = 'GJAHR'.
      wa_fcat-tabname = 'ITAB'.
      APPEND wa_fcat TO t_fcat.
      CLEAR t_fcat.
    ENDFORM.                    " BUILD_FIELDCATALOG
         Form  BUILD_LAYOUT
    FORM BUILD_LAYOUT .
    GD_LAYOUT-NO_INPUT = 'X'.
    GD_LAYOUT-COLWIDTH_OPTIMIZE = 'X'.
    GD_LAYOUT-TOTALS_TEXT = 'TOTALS'.
    ENDFORM.                    " BUILD_LAYOUT
         Form  BUILD_ALV_GRID_DISPLAY
    FORM BUILD_ALV_GRID_DISPLAY .
    gd_repid = sy-repid.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
           EXPORTING
                i_callback_program      = gd_repid
                i_callback_top_of_page  = 'TOP-OF-PAGE'  "see FORM
                i_callback_user_command = 'USER_COMMAND'
                is_layout               = gd_layout
                it_fieldcat             = t_fcat[]
                it_events               = gt_events
                is_print                = gd_prntparams
                it_sort                 = it_sortcat[]
                i_save                  = 'X'
           TABLES
                t_outtab                = ITAB
           EXCEPTIONS
                program_error           = 1
                OTHERS                  = 2.
    thanks and regards
    Murugesh

    TYPES: BEGIN OF XT_TAB,
             LIFNR  LIKE LFA1-LIFNR,
             NAME1  LIKE LFA1-NAME1,
             STCD1  LIKE LFA1-STCD1,
             STCD2  LIKE LFA1-STCD2,
             STCD3  LIKE LFA1-STCD3,
             STCD4  LIKE LFA1-STCD4,
           END OF XT_TAB.
    TYPES: BEGIN OF YT_TAB,
            BUKRS LIKE BSEG-BUKRS,
            BELNR LIKE BSEG-BELNR,
            BUZEI LIKE BSEG-BUZEI,
            LIFNR LIKE BSEG-LIFNR,
            GJAHR LIKE BSEG-GJAHR,
           END OF YT_TAB.
    TYPES: BEGIN OF ZT_TAB,
            LIFNR  LIKE LFA1-LIFNR,
            NAME1  LIKE LFA1-NAME1,
            STCD2  LIKE LFA1-STCD2,
            BELNR  LIKE BSEG-BELNR,
            BUZEI  LIKE BSEG-BUZEI,
            GJAHR  LIKE BSEG-GJAHR,
           END OF ZT_TAB.
           I N T E R N A L   T A B L E   D E C L A R A T I O N S         *
    *-----Internal table to store data
    DATA: ITAB1   TYPE STANDARD TABLE OF XT_TAB INITIAL SIZE 0,
          WA_TAB1 TYPE XT_TAB.
    DATA: ITAB2   TYPE STANDARD TABLE OF YT_TAB INITIAL SIZE 0,
          WA_TAB2 TYPE YT_TAB.
    DATA:   ITAB  TYPE STANDARD TABLE OF  ZT_TAB  WITH HEADER LINE,
            WA_ITAB TYPE ZT_TAB,
            ITAB_FINAL2 TYPE STANDARD TABLE OF ZT_TAB.
    DATA: ITAB_TEMP1 TYPE STANDARD TABLE OF ZT_TAB  WITH HEADER LINE.
                    Selection Screen Declarations                        *
    SELECTION-SCREEN BEGIN OF BLOCK bk1 WITH FRAME TITLE text-001.
    SELECTION-SCREEN SKIP.
    SELECTION-SCREEN begin OF LINE.
    SELECTION-SCREEN COMMENT (23) text-003 FOR FIELD P_LIFNR.
    PARAMETERS P_LIFNR LIKE LFA1-LIFNR OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN SKIP.
    SELECTION-SCREEN END OF BLOCK bk1.
    START-OF-SELECTION.
          PERFORM XTRACT_DATA.
    END-OF-SELECTION.
    *-----Filling the Output table
      PERFORM populate_main_table.
          PERFORM BUILD_FIELDCATALOG.
         PERFORM SORTING.
          PERFORM BUILD_LAYOUT.
          PERFORM BUILD_ALV_GRID_DISPLAY.
         Form  XTRACT_DATA
    FORM XTRACT_DATA .
    *SELECT
          a~LIFNR
          a~NAME1
          a~STCD2
          b~BELNR
          b~BUZEI
          b~GJAHR
    INTO TABLE ITAB
    FROM LFA1 as a INNER JOIN BSEG as b
      ON  aLIFNR = bLIFNR
    WHERE  a~LIFNR = P_LIFNR.
    SELECT LIFNR
           NAME1
           STCD1
           STCD2
           STCD3
           STCD4
      FROM LFA1
      INTO TABLE ITAB1
      WHERE LIFNR = P_LIFNR.
    IF NOT ITAB1[] IS INITIAL.
        SORT ITAB1 BY LIFNR.
        SELECT BELNR
               BUZEI
               LIFNR
               GJAHR
    INTO TABLE ITAB2
          FROM BSEG
    FOR ALL ENTRIES IN ITAB1
    WHERE LIFNR = itab1-lifnr.
    ENDIF.
    ENDFORM.                    " XTRACT_DATA
    *&      Form  POPULATE_MAIN_TABLE
          text
    -->  p1        text
    <--  p2        text
    FORM POPULATE_MAIN_TABLE .
      LOOP AT ITAB1 INTO WA_TAB1.
              ITAB-LIFNR = ITAB1-LIFNR.
              ITAB-NAME1 = ITAB1-NAME1.
              ITAB-STCD2 = ITAB1-STCD2.
      READ TABLE ITAB2 INTO WA_TAB2 WITH KEY LIFNR = WA_TAB1-LIFNR.
              IF sy-subrc = 0.
              ITAB-BELNR = ITAB1-BELNR.
              ITAB-BUZEI = ITAB1-BUZEI.
              ITAB-GJAHR = ITAB1-GJAHR.
              ENDIF.
    ENDLOOP.
    LOOP AT itab1 INTO wa_tab1.
       MOVE:  wa_tab1-lifnr TO itab-lifnr,
              wa_tab1-name1 TO itab-name1,
              wa_tab1-stcd2 TO itab-stcd2.
          Append itab.
      READ TABLE itab2 TRANSPORTING NO FIELDS WITH KEY lifnr = wa_tab1-lifnr.
      IF sy-subrc eq 0.
        MOVE: wa_tab2-lifnr TO itab-lifnr,
              wa_tab2-belnr TO itab-belnr,
              wa_tab2-buzei TO itab-buzei,
              wa_tab2-gjahr TO itab-gjahr.
      Append itab.
    endif.
    endloop.
    *LOOP AT t_agr_tcodes INTO s_agr_tcodes.
    READ TABLE t_tstc
    TRANSPORTING NO FIELDS
    WITH KEY tcode = s_agr_tcodes-tcode.
    IF sy-subrc eq 0.
       MOVE: s_agr_tcodes-tcode TO it_agr_tcodes-tcode,
             s_agr_tcodes-agr_name to it_agr_tcodes-agr_name,
             t_tstc-pgmna to it_agr_pgmna.
    *Append it_agr_tcodes.
    *endif.
    *endloop.
      ENDFORM.                    " POPULATE_MAIN_TABLE
         Form  BUILD_FIELDCATALOG
    FORM BUILD_FIELDCATALOG .
      REFRESH t_fcat.
      CLEAR t_fcat.
      wa_fcat-col_pos = 1.
      wa_fcat-row_pos = 1.
      wa_fcat-seltext_s = 'Vendor Number'.
      wa_fcat-seltext_m = 'Vendor Number'.
      wa_fcat-seltext_l = 'Vendor Number'.
      wa_fcat-fieldname = 'LIFNR'.
      wa_fcat-tabname = 'ITAB'.
      APPEND wa_fcat TO t_fcat.
      CLEAR t_fcat.
      wa_fcat-col_pos = 2.
      wa_fcat-row_pos = 1.
      wa_fcat-seltext_s = 'Vendor Name'.
      wa_fcat-seltext_m = 'Vendor Name'.
      wa_fcat-seltext_l = 'Vendor Name'.
      wa_fcat-fieldname = 'NAME1'.
      wa_fcat-tabname = 'ITAB'.
      APPEND wa_fcat TO t_fcat.
      CLEAR t_fcat.
      wa_fcat-col_pos = 3.
      wa_fcat-row_pos = 1.
      wa_fcat-seltext_s = 'Vendor TIN Number'.
      wa_fcat-seltext_m = 'Vendor TIN Number'.
      wa_fcat-seltext_l = 'Vendor TIN Number'.
      wa_fcat-fieldname = 'STCD2'.
      wa_fcat-tabname = 'ITAB'.
      APPEND wa_fcat TO t_fcat.
      CLEAR t_fcat.
      wa_fcat-col_pos = 4.
      wa_fcat-row_pos = 1.
      wa_fcat-seltext_s = 'Document No'.
      wa_fcat-seltext_m = 'Document No'.
      wa_fcat-seltext_l = 'Document No'.
      wa_fcat-fieldname = 'BELNR'.
      wa_fcat-tabname = 'ITAB'.
      APPEND wa_fcat TO t_fcat.
      CLEAR t_fcat.
      wa_fcat-col_pos = 5.
      wa_fcat-row_pos = 1.
      wa_fcat-seltext_s = 'Item Number'.
      wa_fcat-seltext_m = 'Item Number'.
      wa_fcat-seltext_l = 'Item Number'.
      wa_fcat-fieldname = 'BUZEI'.
      wa_fcat-tabname = 'ITAB'.
      APPEND wa_fcat TO t_fcat.
      CLEAR t_fcat.
      wa_fcat-col_pos = 6.
      wa_fcat-row_pos = 1.
      wa_fcat-seltext_s = 'Fiscal Year'.
      wa_fcat-seltext_m = 'Fiscal Year'.
      wa_fcat-seltext_l = 'Fiscal Year'.
      wa_fcat-fieldname = 'GJAHR'.
      wa_fcat-tabname = 'ITAB'.
      APPEND wa_fcat TO t_fcat.
      CLEAR t_fcat.
    ENDFORM.                    " BUILD_FIELDCATALOG
         Form  BUILD_LAYOUT
    FORM BUILD_LAYOUT .
    GD_LAYOUT-NO_INPUT = 'X'.
    GD_LAYOUT-COLWIDTH_OPTIMIZE = 'X'.
    GD_LAYOUT-TOTALS_TEXT = 'TOTALS'.
    ENDFORM.                    " BUILD_LAYOUT
         Form  BUILD_ALV_GRID_DISPLAY
    FORM BUILD_ALV_GRID_DISPLAY .
    gd_repid = sy-repid.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
           EXPORTING
                i_callback_program      = gd_repid
                i_callback_top_of_page  = 'TOP-OF-PAGE'  "see FORM
                i_callback_user_command = 'USER_COMMAND'
                is_layout               = gd_layout
                it_fieldcat             = t_fcat[]
                it_events               = gt_events
                is_print                = gd_prntparams
                it_sort                 = it_sortcat[]
                i_save                  = 'X'
           TABLES
                t_outtab                = ITAB
           EXCEPTIONS
                program_error           = 1
                OTHERS                  = 2.
    Edited by: Murugesh P on Apr 6, 2009 10:54 AM
    Edited by: Murugesh P on Apr 6, 2009 10:54 AM

  • How  to grow the report of customer's openitem with sales order

    How  to grow the report of customer's open item with sales order?
    Now we can get the customer's open item with invoice No easily,but our end user need the the customer's open item also with sales order .And because a invoice to multi sales orders. I can do nothing.
    Now I have a idea that a develivey No with one sales order , and one invoice with a sales order's develivery ,then one inovice to one sales order .  I want to  know if other company have use this idea. Or have other solution for my problem.

    Hi Yuzhou Yang ,
      Yes you are right. In FI transaction you can get the sales invoice wise , reference field of the header data.
      As you are aware that while creating a sales order , no FI entry is generated.
      In my opinion you can get the required report through customization.
    Thanks
    D.K.Lakshmi narayana

Maybe you are looking for