2007 Oct 01 6:59 AM
Hi Experts1
I am new to abap
Please help me i am using alv in my program , but i get the short dump as field symbol has not assigned yet
below is the code......
&----
*& Report ZSAN_FI_CAPACITY_BUSINESS
*&
&----
*&
*&
&----
REPORT ZSAN_FI_CAPACITY_BUSINESS.
TYPE-POOLS: SLIS.
TABLES:VBAK,VBAP,VEDA,KNA1,VBKD.
DATA: IT_FCAT TYPE SLIS_T_FIELDCAT_ALV,
WA_FCAT TYPE SLIS_FIELDCAT_ALV.
DATA I_REPID LIKE SY-REPID.
&----
*&TYPE DECLARATION OFfinal display for alv TABLE.
&----
TYPES: BEGIN OF T_DISPLAY,
NAME1 TYPE KNA1-NAME1, "CUSTOMER NAME
VBELN TYPE VBAP-VBELN, "Delivery, Sales Document
POSNR TYPE VBAP-POSNR, "Sales Document Item
KDMAT TYPE VBAP-KDMAT, "customer connection ID.Material Number Used by Customer
ARKTX TYPE VBAP-ARKTX, "Short text for sales order item
KTEXT TYPE VBAK-KTEXT, "Search term for product proposal
IHREZ TYPE VBKD-IHREZ, "Customer's or vendor's internal reference
VINSDAT TYPE VEDA-VINSDAT, "Installation date
VABNDT TYPE VEDA-VABNDAT, "Acceptance date
VDEMDAT TYPE VEDA-VDEMDAT, "dismantling date
FAKSP TYPE VBAP-FAKSP, "Billing block for item
bukrs_vf TYPE vbak-bukrs_vf,
END OF T_DISPLAY.
DATA: WA_DISPLAY TYPE T_DISPLAY.
DATA: IT_DISPLAY TYPE TABLE OF T_DISPLAY .
----
*&DATA DECLARATIONS FOR SELECT OPTIONS.
&----
DATA: S_ERNAM TYPE VBAK-ERNAM, "created by
S_VBELN TYPE VBAK-VBELN , "sales Contract
S_BUKRS TYPE VBAK-BUKRS_VF, "company code to be billed
S_VKORG TYPE VBAK-VKORG, "Sales Organaization
S_FAKSP TYPE VBAP-FAKSP , "Billing block Reason
S_ERDAT TYPE VBAK-ERDAT , "Record creation date
S_AEDAT TYPE VBAK-AEDAT, "Last changed date
S_KDMAT TYPE VBAP-KDMAT, "customer connection Id
S_BSTKD_E TYPE VBKD-BSTKD_E, "ship to Party order adress.
S_IRHEZ TYPE VBKD-IHREZ, "your refrence
S_VINSDAT TYPE VEDA-VINSDAT, "installation date
S_VABNDAT TYPE VEDA-VABNDAT, "Acceptance date
S_VDEMDAT TYPE VEDA-VDEMDAT . "dismantling date
----
*&SELECTION SCREENS DEFINED..
&----
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME .
SELECT-OPTIONS: USERNAME FOR S_ERNAM NO INTERVALS NO-EXTENSION ,
CONTRACT FOR S_VBELN ,
COMPCODE FOR S_BUKRS,
SALESORG FOR S_VKORG,
RECORDDT FOR S_ERDAT,
LASTDATE FOR S_AEDAT.
SELECTION-SCREEN END OF BLOCK B2.
SELECTION-SCREEN BEGIN OF BLOCK B3 WITH FRAME .
SELECT-OPTIONS:BILLING FOR S_FAKSP,
CUSTOMID FOR S_KDMAT,
SHIPTO FOR S_BSTKD_E ,
REFRENCE FOR S_IRHEZ,
INSTALDT FOR S_VINSDAT,
ACCEPTDT FOR S_VABNDAT,
VDEMDAT FOR S_VDEMDAT.
SELECTION-SCREEN END OF BLOCK B3.
SELECTION-SCREEN END OF BLOCK B1.
----
*&TYPE DECLARATIONS FOR FOR BILLING BLOCKG i.e HEADER DATA.VBAK DATA.
&----
TYPES: BEGIN OF LT_VBAK,
VBELN TYPE VBAK-VBELN, "Sales Document
KTEXT TYPE VBAK-VKORG, "Search term for product proposal
KUNNR TYPE VBAK-KUNNR,
END OF LT_VBAK.
DATA: IT_VBAK TYPE TABLE OF LT_VBAK .
DATA: WA_VBAK TYPE LT_VBAK.
----
*&TYPE DECLARATIONS FOR FOR BILLING BLOCKG i.e ITEM DATA.VBAP DATA.
&----
TYPES: BEGIN OF LT_VBAP,
KDMAT TYPE VBAP-KDMAT, "customer connection ID.Material Number Used by Customer
VBELN TYPE VBAP-VBELN, "Delivery, Sales Document
POSNR TYPE VBAP-POSNR, "Sales Document Item
ARKTX TYPE VBAP-ARKTX, "Short text for sales order item
FAKSP TYPE VBAP-FAKSP, "Billing block for item
END OF LT_VBAP.
DATA: IT_VBAP TYPE TABLE OF LT_VBAP .
DATA: WA_VBAP TYPE LT_VBAP.
----
*&TYPE DECLARATIONS FOR FOR BILLING BLOCKG i.ITEM LINE DATA.VBKD DATA.
&----
TYPES: BEGIN OF LT_VBKD,
VBELN TYPE VBKD-VBELN,
POSNR TYPE VBKD-POSNR,
IHREZ TYPE VBKD-IHREZ, "Customer's or vendor's internal reference
END OF LT_VBKD.
DATA: IT_VBKD TYPE TABLE OF LT_VBKD .
DATA: WA_VBKD TYPE LT_VBKD.
----
*&TYPE DECLARATIONS FOR FOR BILLING BLOCKG contract data i.VEDA DATA.
&----
TYPES: BEGIN OF LT_VEDA,
VBELN TYPE VEDA-VBELN,
VINSDAT TYPE VEDA-VINSDAT, "Installation date
VABNDT TYPE VEDA-VABNDAT, "Acceptance date
VDEMDAT TYPE VEDA-VDEMDAT, "dismantling date
END OF LT_VEDA.
DATA: IT_VEDA TYPE TABLE OF LT_VEDA .
DATA: WA_VEDA TYPE LT_VEDA.
----
*&TYPE DECLARATIONS FOR FOR BILLING BLOCKG iuser name data.
&----
TYPES: BEGIN OF LT_KNA1,
KUNNR TYPE KNA1-KUNNR,
NAME1 TYPE KNA1-NAME1, "Customer's or vendor's internal reference
END OF LT_KNA1.
DATA: IT_KNA1 TYPE TABLE OF LT_KNA1.
DATA: WA_KNA1 TYPE LT_KNA1.
Store report name
I_REPID = SY-REPID.
----
*& select query
&----
START-OF-SELECTION.
SELECT VBELN KTEXT KUNNR FROM VBAK INTO TABLE IT_VBAK
WHERE VKORG IN SALESORG
AND BUKRS_VF IN COMPCODE
AND ERDAT IN RECORDDT
AND AEDAT IN LASTDATE
AND ERNAM IN USERNAME
AND VBELN IN CONTRACT .
IF IT_VBAK IS NOT INITIAL.
SELECT VBELN KDMAT POSNR ARKTX FAKSP FROM VBAP INTO CORRESPONDING
FIELDS OF TABLE IT_VBAP
FOR ALL ENTRIES IN IT_VBAK
WHERE VBELN = IT_VBAK-VBELN
AND KDMAT IN CUSTOMID
AND FAKSP IN BILLING .
SELECT KUNNR NAME1 FROM KNA1 INTO CORRESPONDING FIELDS OF TABLE IT_KNA1
FOR ALL ENTRIES IN IT_VBAK
WHERE KUNNR = IT_VBAK-KUNNR.
IF IT_VBAP IS NOT INITIAL.
SELECT IHREZ FROM VBKD INTO CORRESPONDING FIELDS OF TABLE IT_VBKD
FOR ALL ENTRIES IN IT_VBAP
WHERE VBELN = IT_VBAP-VBELN
AND POSNR = IT_VBAP-POSNR
AND IHREZ IN REFRENCE
AND BSTKD_E IN SHIPTO .
SELECT VBELN VABNDAT VINSDAT VDEMDAT FROM VEDA INTO CORRESPONDING
FIELDS OF TABLE IT_VEDA
FOR ALL ENTRIES IN IT_VBAP
WHERE VBELN = IT_VBAP-VBELN
AND VINSDAT IN INSTALDT
AND VABNDAT IN ACCEPTDT
AND VDEMDAT IN VDEMDAT .
ENDIF.
ENDIF.
*----
**& final display adding all internal tables.
*&----
*
SORT IT_VBAK BY VBELN.
SORT IT_VBAP BY VBELN POSNR.
SORT IT_KNA1 BY KUNNR.
LOOP AT IT_VBAK INTO WA_VBAK.
READ TABLE IT_VBAP INTO WA_VBAP WITH KEY VBELN = WA_VBAK-VBELN.
READ TABLE IT_KNA1 INTO WA_KNA1 WITH KEY KUNNR = WA_VBAK-KUNNR.
SORT IT_VBKD BY VBELN POSNR.
SORT IT_VEDA BY VBELN .
LOOP AT IT_VBAP INTO WA_VBAP .
READ TABLE IT_VBKD INTO WA_VBKD WITH KEY VBELN = WA_VBAP-VBELN POSNR = WA_VBAP-POSNR.
READ TABLE IT_VEDA INTO WA_VEDA WITH KEY VBELN = WA_VEDA-VBELN.
MOVE-CORRESPONDING WA_VBKD TO WA_DISPLAY.
MOVE-CORRESPONDING WA_VEDA TO WA_DISPLAY.
ENDLOOP.
MOVE-CORRESPONDING WA_VBAK TO WA_DISPLAY.
MOVE-CORRESPONDING WA_VBAP TO WA_DISPLAY.
MOVE-CORRESPONDING WA_KNA1 TO WA_DISPLAY.
APPEND WA_DISPLAY TO IT_DISPLAY.
ENDLOOP.
***************************************************************************
ALV DISPAY
****************************************************************************
PERFORM BUILD_FIELDCATALOG.
PERFORM ALV_DISPLAY.
&----
*& Form build_fieldcatalog
&----
text
----
--> p1 text
<-- p2 text
----
FORM BUILD_FIELDCATALOG .
REFRESH IT_FCAT.
CLEAR WA_FCAT.
WA_FCAT-FIELDNAME = 'NAME1'.
WA_FCAT-TABNAME = 'IT_DISPLAY'.
WA_FCAT-SELTEXT_M = 'CUSTOMER NAME'.
WA_FCAT-COL_POS = 1.
APPEND WA_FCAT TO IT_FCAT.
CLEAR WA_FCAT.
WA_FCAT-FIELDNAME = 'VBELN'.
WA_FCAT-TABNAME = 'IT_DISPLAY'.
WA_FCAT-SELTEXT_M = 'SALES DOCUMENT'.
WA_FCAT-COL_POS = 2.
APPEND WA_FCAT TO IT_FCAT.
CLEAR WA_FCAT.
WA_FCAT-FIELDNAME = 'POSNR'.
WA_FCAT-TABNAME = 'IT_DISPLAY'.
WA_FCAT-SELTEXT_M = 'SALES DOCUMENT ITEM'.
WA_FCAT-COL_POS = 3.
APPEND WA_FCAT TO IT_FCAT.
CLEAR WA_FCAT.
WA_FCAT-FIELDNAME = 'KDMAT'.
WA_FCAT-TABNAME = 'IT_DISPLAY'.
WA_FCAT-SELTEXT_M = 'CUSTOMER CONNECTION ID'.
WA_FCAT-COL_POS = 4.
APPEND WA_FCAT TO IT_FCAT.
CLEAR WA_FCAT.
WA_FCAT-FIELDNAME = 'ARKTX'.
WA_FCAT-TABNAME = 'IT_DISPLAY'.
WA_FCAT-SELTEXT_M = 'SHORT TEXT FOR SALES ORDER ITEM'.
WA_FCAT-COL_POS = 5.
APPEND WA_FCAT TO IT_FCAT.
CLEAR WA_FCAT.
WA_FCAT-FIELDNAME = 'KTEXT'.
WA_FCAT-TABNAME = 'IT_DISPLAY'.
WA_FCAT-SELTEXT_M = 'SEARCH ITEM'.
WA_FCAT-COL_POS = 6.
APPEND WA_FCAT TO IT_FCAT.
CLEAR WA_FCAT.
WA_FCAT-FIELDNAME = 'IHREZ'.
WA_FCAT-TABNAME = 'IT_DISPLAY'.
WA_FCAT-SELTEXT_M = 'YOUR REFERENCE'.
WA_FCAT-COL_POS = 7.
APPEND WA_FCAT TO IT_FCAT.
CLEAR WA_FCAT.
WA_FCAT-FIELDNAME = 'VINSDAT'.
WA_FCAT-TABNAME = 'IT_DISPLAY'.
WA_FCAT-SELTEXT_M = 'INSTALLATION DATE'.
WA_FCAT-COL_POS = 8.
APPEND WA_FCAT TO IT_FCAT.
CLEAR WA_FCAT.
WA_FCAT-FIELDNAME = 'VABNDAT'.
WA_FCAT-TABNAME = 'IT_DISPLAY'.
WA_FCAT-SELTEXT_M = 'ACCEPTANCE DATE'.
WA_FCAT-COL_POS = 9.
APPEND WA_FCAT TO IT_FCAT.
CLEAR WA_FCAT.
WA_FCAT-FIELDNAME = 'VDEMDAT'.
WA_FCAT-TABNAME = 'IT_DISPLAY'.
WA_FCAT-SELTEXT_M = 'DISMANTLING DATE'.
WA_FCAT-COL_POS = 10.
APPEND WA_FCAT TO IT_FCAT.
CLEAR WA_FCAT.
WA_FCAT-FIELDNAME = 'FAKSP'.
WA_FCAT-TABNAME = 'IT_DISPLAY'.
WA_FCAT-SELTEXT_M = 'BILLING BLOCK REASON'.
WA_FCAT-COL_POS = 11.
APPEND WA_FCAT TO IT_FCAT.
CLEAR WA_FCAT.
ENDFORM. " build_fieldcatalog
&----
*& Form alv_display
&----
text
----
--> p1 text
<-- p2 text
----
FORM ALV_DISPLAY .
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = ' '
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
I_STRUCTURE_NAME =
IS_LAYOUT =
IT_FIELDCAT = IT_FCAT
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS =
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
IR_SALV_LIST_ADAPTER =
IT_EXCEPT_QINFO =
I_SUPPRESS_EMPTY_DATA = ABAP_FALSE
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = IT_DISPLAY
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
2007 Oct 01 7:03 AM
Hi ,
Check out the fieldcatalog in debug mode there might be some problem with the fieldcatalog.
regards,
Santosh Thorat
2007 Oct 01 7:03 AM
Hi ,
Check out the fieldcatalog in debug mode there might be some problem with the fieldcatalog.
regards,
Santosh Thorat
2007 Oct 01 7:07 AM
hi santosh fieldcatlog is ok.
i am getting dump in function Reuse_alv_list_display
2007 Oct 01 7:15 AM
Hi ameet,
The problem was this
<b>WA_FCAT-FIELDNAME = 'VABNDAT'</b>.
WA_FCAT-FIELDNAME = 'VABNDT'.
WA_FCAT-TABNAME = 'IT_DISPLAY'.
WA_FCAT-SELTEXT_M = 'ACCEPTANCE DATE'.
WA_FCAT-COL_POS = 9.
APPEND WA_FCAT TO IT_FCAT.
CLEAR WA_FCAT.
regards,
Santosh Thorat
2007 Oct 01 7:23 AM
2007 Oct 01 7:25 AM
2007 Oct 01 7:29 AM
Hi ameet,
Try to download this program.....its ur program only without error.
TYPE-POOLS: SLIS.
TABLES:VBAK,VBAP,VEDA,KNA1,VBKD.
DATA: IT_FCAT TYPE SLIS_T_FIELDCAT_ALV,
WA_FCAT TYPE SLIS_FIELDCAT_ALV.
DATA I_REPID LIKE SY-REPID.
&----
*&TYPE DECLARATION OFfinal display for alv TABLE.
&----
TYPES: BEGIN OF T_DISPLAY,
NAME1 TYPE KNA1-NAME1, "CUSTOMER NAME
VBELN TYPE VBAP-VBELN, "Delivery, Sales Document
POSNR TYPE VBAP-POSNR, "Sales Document Item
KDMAT TYPE VBAP-KDMAT, "customer connection ID.Material Number Used by
Customer,
ARKTX TYPE VBAP-ARKTX, "Short text for sales order item
KTEXT TYPE VBAK-KTEXT, "Search term for product proposal
IHREZ TYPE VBKD-IHREZ, "Customer's or vendor's internal reference
VINSDAT TYPE VEDA-VINSDAT, "Installation date
VABNDT TYPE VEDA-VABNDAT, "Acceptance date
VDEMDAT TYPE VEDA-VDEMDAT, "dismantling date
FAKSP TYPE VBAP-FAKSP, "Billing block for item
bukrs_vf TYPE vbak-bukrs_vf,
END OF T_DISPLAY.
DATA: WA_DISPLAY TYPE T_DISPLAY.
DATA: IT_DISPLAY TYPE TABLE OF T_DISPLAY .
----
*&DATA DECLARATIONS FOR SELECT OPTIONS.
&----
DATA: S_ERNAM TYPE VBAK-ERNAM, "created by
S_VBELN TYPE VBAK-VBELN , "sales Contract
S_BUKRS TYPE VBAK-BUKRS_VF, "company code to be billed
S_VKORG TYPE VBAK-VKORG, "Sales Organaization
S_FAKSP TYPE VBAP-FAKSP , "Billing block Reason
S_ERDAT TYPE VBAK-ERDAT , "Record creation date
S_AEDAT TYPE VBAK-AEDAT, "Last changed date
S_KDMAT TYPE VBAP-KDMAT, "customer connection Id
S_BSTKD_E TYPE VBKD-BSTKD_E, "ship to Party order adress.
S_IRHEZ TYPE VBKD-IHREZ, "your refrence
S_VINSDAT TYPE VEDA-VINSDAT, "installation date
S_VABNDAT TYPE VEDA-VABNDAT, "Acceptance date
S_VDEMDAT TYPE VEDA-VDEMDAT . "dismantling date
----
*&SELECTION SCREENS DEFINED..
&----
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME .
SELECT-OPTIONS: USERNAME FOR S_ERNAM NO INTERVALS NO-EXTENSION ,
CONTRACT FOR S_VBELN ,
COMPCODE FOR S_BUKRS,
SALESORG FOR S_VKORG,
RECORDDT FOR S_ERDAT,
LASTDATE FOR S_AEDAT.
SELECTION-SCREEN END OF BLOCK B2.
SELECTION-SCREEN BEGIN OF BLOCK B3 WITH FRAME .
SELECT-OPTIONS:BILLING FOR S_FAKSP,
CUSTOMID FOR S_KDMAT,
SHIPTO FOR S_BSTKD_E ,
REFRENCE FOR S_IRHEZ,
INSTALDT FOR S_VINSDAT,
ACCEPTDT FOR S_VABNDAT,
VDEMDAT FOR S_VDEMDAT.
SELECTION-SCREEN END OF BLOCK B3.
SELECTION-SCREEN END OF BLOCK B1.
----
*&TYPE DECLARATIONS FOR FOR BILLING BLOCKG i.e HEADER DATA.VBAK DATA.
&----
TYPES: BEGIN OF LT_VBAK,
VBELN TYPE VBAK-VBELN, "Sales Document
KTEXT TYPE VBAK-VKORG, "Search term for product proposal
KUNNR TYPE VBAK-KUNNR,
END OF LT_VBAK.
DATA: IT_VBAK TYPE TABLE OF LT_VBAK .
DATA: WA_VBAK TYPE LT_VBAK.
----
*&TYPE DECLARATIONS FOR FOR BILLING BLOCKG i.e ITEM DATA.VBAP DATA.
&----
TYPES: BEGIN OF LT_VBAP,
KDMAT TYPE VBAP-KDMAT, "customer connection ID.Material Number Used by
"Customer,
VBELN TYPE VBAP-VBELN, "Delivery, Sales Document
POSNR TYPE VBAP-POSNR, "Sales Document Item
ARKTX TYPE VBAP-ARKTX, "Short text for sales order item
FAKSP TYPE VBAP-FAKSP, "Billing block for item
END OF LT_VBAP.
DATA: IT_VBAP TYPE TABLE OF LT_VBAP .
DATA: WA_VBAP TYPE LT_VBAP.
----
*&TYPE DECLARATIONS FOR FOR BILLING BLOCKG i.ITEM LINE DATA.VBKD DATA.
&----
TYPES: BEGIN OF LT_VBKD,
VBELN TYPE VBKD-VBELN,
POSNR TYPE VBKD-POSNR,
IHREZ TYPE VBKD-IHREZ, "Customer's or vendor's internal reference
END OF LT_VBKD.
DATA: IT_VBKD TYPE TABLE OF LT_VBKD .
DATA: WA_VBKD TYPE LT_VBKD.
----
*&TYPE DECLARATIONS FOR FOR BILLING BLOCKG contract data i.VEDA DATA.
&----
TYPES: BEGIN OF LT_VEDA,
VBELN TYPE VEDA-VBELN,
VINSDAT TYPE VEDA-VINSDAT, "Installation date
VABNDT TYPE VEDA-VABNDAT, "Acceptance date
VDEMDAT TYPE VEDA-VDEMDAT, "dismantling date
END OF LT_VEDA.
DATA: IT_VEDA TYPE TABLE OF LT_VEDA .
DATA: WA_VEDA TYPE LT_VEDA.
----
*&TYPE DECLARATIONS FOR FOR BILLING BLOCKG iuser name data.
&----
TYPES: BEGIN OF LT_KNA1,
KUNNR TYPE KNA1-KUNNR,
NAME1 TYPE KNA1-NAME1, "Customer's or vendor's internal reference
END OF LT_KNA1.
DATA: IT_KNA1 TYPE TABLE OF LT_KNA1.
DATA: WA_KNA1 TYPE LT_KNA1.
Store report name
I_REPID = SY-REPID.
----
*& select query
&----
START-OF-SELECTION.
SELECT VBELN KTEXT KUNNR FROM VBAK INTO TABLE IT_VBAK
WHERE VKORG IN SALESORG
AND BUKRS_VF IN COMPCODE
AND ERDAT IN RECORDDT
AND AEDAT IN LASTDATE
AND ERNAM IN USERNAME
AND VBELN IN CONTRACT .
IF IT_VBAK IS NOT INITIAL.
SELECT VBELN KDMAT POSNR ARKTX FAKSP FROM VBAP INTO CORRESPONDING
FIELDS OF TABLE IT_VBAP
FOR ALL ENTRIES IN IT_VBAK
WHERE VBELN = IT_VBAK-VBELN
AND KDMAT IN CUSTOMID
AND FAKSP IN BILLING .
SELECT KUNNR NAME1 FROM KNA1 INTO CORRESPONDING FIELDS OF TABLE IT_KNA1
FOR ALL ENTRIES IN IT_VBAK
WHERE KUNNR = IT_VBAK-KUNNR.
IF IT_VBAP IS NOT INITIAL.
SELECT IHREZ FROM VBKD INTO CORRESPONDING FIELDS OF TABLE IT_VBKD
FOR ALL ENTRIES IN IT_VBAP
WHERE VBELN = IT_VBAP-VBELN
AND POSNR = IT_VBAP-POSNR
AND IHREZ IN REFRENCE
AND BSTKD_E IN SHIPTO .
SELECT VBELN VABNDAT VINSDAT VDEMDAT FROM VEDA INTO CORRESPONDING
FIELDS OF TABLE IT_VEDA
FOR ALL ENTRIES IN IT_VBAP
WHERE VBELN = IT_VBAP-VBELN
AND VINSDAT IN INSTALDT
AND VABNDAT IN ACCEPTDT
AND VDEMDAT IN VDEMDAT .
ENDIF.
ENDIF.
**----
*
**& final display adding all internal tables.
**&----
*
*
SORT IT_VBAK BY VBELN.
SORT IT_VBAP BY VBELN POSNR.
SORT IT_KNA1 BY KUNNR.
LOOP AT IT_VBAK INTO WA_VBAK.
READ TABLE IT_VBAP INTO WA_VBAP WITH KEY VBELN = WA_VBAK-VBELN.
READ TABLE IT_KNA1 INTO WA_KNA1 WITH KEY KUNNR = WA_VBAK-KUNNR.
SORT IT_VBKD BY VBELN POSNR.
SORT IT_VEDA BY VBELN .
LOOP AT IT_VBAP INTO WA_VBAP .
READ TABLE IT_VBKD INTO WA_VBKD WITH KEY VBELN = WA_VBAP-VBELN POSNR =
WA_VBAP-POSNR.
READ TABLE IT_VEDA INTO WA_VEDA WITH KEY VBELN = WA_VEDA-VBELN.
MOVE-CORRESPONDING WA_VBKD TO WA_DISPLAY.
MOVE-CORRESPONDING WA_VEDA TO WA_DISPLAY.
ENDLOOP.
MOVE-CORRESPONDING WA_VBAK TO WA_DISPLAY.
MOVE-CORRESPONDING WA_VBAP TO WA_DISPLAY.
MOVE-CORRESPONDING WA_KNA1 TO WA_DISPLAY.
APPEND WA_DISPLAY TO IT_DISPLAY.
ENDLOOP.
************************************************************************
***
ALV DISPAY
************************************************************************
****
PERFORM BUILD_FIELDCATALOG.
PERFORM ALV_DISPLAY.
&----
*& Form build_fieldcatalog
&----
text
----
--> p1 text
<-- p2 text
----
FORM BUILD_FIELDCATALOG .
REFRESH IT_FCAT.
CLEAR WA_FCAT.
WA_FCAT-FIELDNAME = 'NAME1'.
WA_FCAT-TABNAME = 'IT_DISPLAY'.
WA_FCAT-SELTEXT_M = 'CUSTOMER NAME'.
WA_FCAT-COL_POS = 1.
APPEND WA_FCAT TO IT_FCAT.
CLEAR WA_FCAT.
WA_FCAT-FIELDNAME = 'VBELN'.
WA_FCAT-TABNAME = 'IT_DISPLAY'.
WA_FCAT-SELTEXT_M = 'SALES DOCUMENT'.
WA_FCAT-COL_POS = 2.
APPEND WA_FCAT TO IT_FCAT.
CLEAR WA_FCAT.
WA_FCAT-FIELDNAME = 'POSNR'.
WA_FCAT-TABNAME = 'IT_DISPLAY'.
WA_FCAT-SELTEXT_M = 'SALES DOCUMENT ITEM'.
WA_FCAT-COL_POS = 3.
APPEND WA_FCAT TO IT_FCAT.
CLEAR WA_FCAT.
WA_FCAT-FIELDNAME = 'KDMAT'.
WA_FCAT-TABNAME = 'IT_DISPLAY'.
WA_FCAT-SELTEXT_M = 'CUSTOMER CONNECTION ID'.
WA_FCAT-COL_POS = 4.
APPEND WA_FCAT TO IT_FCAT.
CLEAR WA_FCAT.
WA_FCAT-FIELDNAME = 'ARKTX'.
WA_FCAT-TABNAME = 'IT_DISPLAY'.
WA_FCAT-SELTEXT_M = 'SHORT TEXT FOR SALES ORDER ITEM'.
WA_FCAT-COL_POS = 5.
APPEND WA_FCAT TO IT_FCAT.
CLEAR WA_FCAT.
WA_FCAT-FIELDNAME = 'KTEXT'.
WA_FCAT-TABNAME = 'IT_DISPLAY'.
WA_FCAT-SELTEXT_M = 'SEARCH ITEM'.
WA_FCAT-COL_POS = 6.
APPEND WA_FCAT TO IT_FCAT.
CLEAR WA_FCAT.
WA_FCAT-FIELDNAME = 'IHREZ'.
WA_FCAT-TABNAME = 'IT_DISPLAY'.
WA_FCAT-SELTEXT_M = 'YOUR REFERENCE'.
WA_FCAT-COL_POS = 7.
APPEND WA_FCAT TO IT_FCAT.
CLEAR WA_FCAT.
WA_FCAT-FIELDNAME = 'VINSDAT'.
WA_FCAT-TABNAME = 'IT_DISPLAY'.
WA_FCAT-SELTEXT_M = 'INSTALLATION DATE'.
WA_FCAT-COL_POS = 8.
APPEND WA_FCAT TO IT_FCAT.
CLEAR WA_FCAT.
WA_FCAT-FIELDNAME = 'VABNDT'.
WA_FCAT-TABNAME = 'IT_DISPLAY'.
WA_FCAT-SELTEXT_M = 'ACCEPTANCE DATE'.
WA_FCAT-COL_POS = 9.
APPEND WA_FCAT TO IT_FCAT.
CLEAR WA_FCAT.
WA_FCAT-FIELDNAME = 'VDEMDAT'.
WA_FCAT-TABNAME = 'IT_DISPLAY'.
WA_FCAT-SELTEXT_M = 'DISMANTLING DATE'.
WA_FCAT-COL_POS = 10.
APPEND WA_FCAT TO IT_FCAT.
CLEAR WA_FCAT.
WA_FCAT-FIELDNAME = 'FAKSP'.
WA_FCAT-TABNAME = 'IT_DISPLAY'.
WA_FCAT-SELTEXT_M = 'BILLING BLOCK REASON'.
WA_FCAT-COL_POS = 11.
APPEND WA_FCAT TO IT_FCAT.
CLEAR WA_FCAT.
ENDFORM. " build_fieldcatalog
&----
*& Form alv_display
&----
text
----
--> p1 text
<-- p2 text
----
FORM ALV_DISPLAY .
CALL FUNCTION 'REUSE_ALV_LIST_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 = ' '
I_STRUCTURE_NAME =
IS_LAYOUT =
IT_FIELDCAT = IT_FCAT[]
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS =
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
IR_SALV_LIST_ADAPTER =
IT_EXCEPT_QINFO =
I_SUPPRESS_EMPTY_DATA = ABAP_FALSE
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = IT_DISPLAY[]
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
regards,
Santosh thorat
2007 Oct 01 7:32 AM
Hi Santosh
u solved my problem
that was spelling mistake
Thanks and regads Ameet
i am rewarding marks to you
2007 Oct 01 7:34 AM
Hi Experts
I am using nested loops
but as it is not good practice
please send me alternative for this......
LOOP AT IT_VBAK INTO WA_VBAK.
READ TABLE IT_VBAP INTO WA_VBAP WITH KEY VBELN = WA_VBAK-VBELN.
READ TABLE IT_KNA1 INTO WA_KNA1 WITH KEY KUNNR = WA_VBAK-KUNNR.
SORT IT_VBKD BY VBELN POSNR.
SORT IT_VEDA BY VBELN .
LOOP AT IT_VBAP INTO WA_VBAP .
READ TABLE IT_VBKD INTO WA_VBKD WITH KEY VBELN = WA_VBAP-VBELN POSNR =
WA_VBAP-POSNR.
READ TABLE IT_VEDA INTO WA_VEDA WITH KEY VBELN = WA_VEDA-VBELN.
MOVE-CORRESPONDING WA_VBKD TO WA_DISPLAY.
MOVE-CORRESPONDING WA_VEDA TO WA_DISPLAY.
ENDLOOP.
MOVE-CORRESPONDING WA_VBAK TO WA_DISPLAY.
MOVE-CORRESPONDING WA_VBAP TO WA_DISPLAY.
MOVE-CORRESPONDING WA_KNA1 TO WA_DISPLAY.
APPEND WA_DISPLAY TO IT_DISPLAY
2007 Oct 01 7:07 AM
Hi Ameet-
You have not given the program name in I_CALLBACK_PROGRAM under the function module. Pass the program name to this importing parameter and you will not get the dump.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE = ' '
<b> I_CALLBACK_PROGRAM = "Give your program name here"</b>
Reward if it is useful to you..
Cheers
Shakir
2007 Oct 01 7:07 AM
I dont see any field-symbol declaration. At which line the dump occurs ?
2007 Oct 01 7:14 AM
<b>srivijaya</b>
when you go inside the Reuse alv list display then it goes into inbuilt code of function module
and then it gives dump to me
2007 Oct 01 7:11 AM
hi, can u send the dump , so that we can see where its going wrong?
2007 Oct 01 7:16 AM