Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Error IN ABAP PROGRAM AT PRINT PREVIEW

Former Member
0 Kudos

Dear All experts.

i got an error at gone to print preview of sales order delivery ALV reports. it gives an error follwing.

GETWA_NOT_ASSIGNED.

FIELD SYMBOL HAS BEEN NOT ASSIGNED.

BHAVESH PANCHAL

6 REPLIES 6

Former Member
0 Kudos

Can you please paste code here.

0 Kudos

Dear Expert.

thnks for reply.

Just check my code. Also check my output.

thnks

&----


*& Report Z_SALES_EXP_BHAVESH

*&

&----


*&

*&

&----


REPORT Z_SALES_EXP_BHAVESH.

TYPE-POOLS:slis.

&----


  • TABLES

&----


TABLES: vbep,

vbap,

vbpa,

vbkd,

vbak,

likp,

lips,

vbup,

vbbe,

konv,

kna1.

DATA :BEGIN OF itab OCCURS 0,

vbeln LIKE vbak-vbeln,

posnr LIKE vbap-posnr,

edatu LIKE vbep-edatu,

knumv LIKE vbak-knumv,

wmeng LIKE vbep-wmeng,

bmeng LIKE vbep-bmeng,

lfimg LIKE lips-lfimg,

omeng LIKE vbbe-omeng,

posar LIKE vbap-posar,

netwr LIKE vbap-netwr,

ntgew LIKE vbap-ntgew,

kbetr LIKE konv-kbetr,

kwert LIKE konv-kwert, " CONDITION VALUE.

kunnr LIKE vbak-kunnr,

name1 LIKE kna1-name1,

*BRGEW LIKE VBAP-BRGEW,

bstkd LIKE vbkd-bstkd,

bstdk LIKE vbkd-bstdk,

lfsta LIKE vbup-lfsta,

*KNUMV LIKE VBAK-KNUMV,

*posnr LIKE LIPS-POSNR,

*NETWR LIKE VBAK-NETWR,

brgew LIKE vbap-brgew,

LFMNG like vbap-LFMNG,

lfdat LIKE likp-lfdat,

*NTGEW LIKE LIKP-NTGEW,

delivery LIKE lips-vbeln,

*LFIMG LIKE LIPS-LFIMG,

KWMENG like VBAP-KWMENG,

op_qty like VBAP-KWMENG,

weight LIKE vbap-ntgew,

pending_val LIKE vbap-netwr,

END OF itab.

*variable for Report ID

DATA: v_repid LIKE sy-repid .

*declaration for fieldcatalog

DATA: i_fieldcat TYPE slis_t_fieldcat_alv,

wa_fieldcat TYPE slis_fieldcat_alv.

DATA: it_listheader TYPE slis_t_listheader.

  • declartion for layout

DATA: alv_layout TYPE slis_layout_alv.

*Title displayed when the alv list is displayed

*DATA: i_title_main TYPE lvc_title VALUE 'FIRST LIST DISPLAYED'.

DATA: i_title_main TYPE lvc_title VALUE 'Reports : Bhavesh Panchal'.

DATA : it_vbak TYPE vbak OCCURS 0 WITH HEADER LINE,

it_vbap TYPE vbap OCCURS 0 WITH HEADER LINE,

it_vbrk TYPE vbrk OCCURS 0 WITH HEADER LINE,

it_vbrp TYPE vbrp OCCURS 0 WITH HEADER LINE,

it_vbep TYPE vbep OCCURS 0 WITH HEADER LINE,

it_vbpa TYPE vbpa OCCURS 0 WITH HEADER LINE,

it_lips TYPE lips OCCURS 0 WITH HEADER LINE ,

it_likp TYPE likp OCCURS 0 WITH HEADER LINE,

it_konv TYPE konv OCCURS 0 WITH HEADER LINE,

it_kna1 TYPE kna1 OCCURS 0 WITH HEADER LINE,

it_adrc TYPE adrc OCCURS 0 WITH HEADER LINE,

it_makt TYPE makt OCCURS 0 WITH HEADER LINE,

it_mara TYPE mara OCCURS 0 WITH HEADER LINE,

it_vbkd TYPE vbkd OCCURS 0 WITH HEADER LINE,

it_vbbe TYPE vbbe OCCURS 0 WITH HEADER LINE,

it_vbup TYPE vbup OCCURS 0 WITH HEADER LINE,

it_itob TYPE itob OCCURS 0 WITH HEADER LINE.

INITIALIZATION.

v_repid = sy-repid.

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.

SELECT-OPTIONS : so_vbeln FOR vbak-vbeln ,

so_kunnr FOR vbpa-kunnr,

so_edatu FOR itab-edatu.

SELECTION-SCREEN: END OF BLOCK b1.

START-OF-SELECTION.

  • get the details required to be displayed in the report

PERFORM fetch_data.

&----


*& End-of-Selection

&----


END-OF-SELECTION.

IF itab[] IS NOT INITIAL.

  • initialize the fieldcatlog to be used for alv grid display

PERFORM field_catalog.

  • display actual data in the alv grid

PERFORM display.

ELSE.

  • initialize the fieldcatlog to be used for alv grid display

PERFORM field_catalog.

  • display actual data in the alv grid

PERFORM display.

ENDIF.

&----


*& Form build_fieldcatlog

&----


  • text

----


FORM field_catalog.

*- Show quoted text -

wa_fieldcat-tabname = 'ITAB'.

wa_fieldcat-fieldname = 'VBELN'.

wa_fieldcat-seltext_m = 'SalesOrderNo'.

wa_fieldcat-outputlen = '12'.

APPEND wa_fieldcat TO i_fieldcat.

CLEAR wa_fieldcat.

  • Field for Customer Name.

wa_fieldcat-tabname = 'ITAB'.

wa_fieldcat-fieldname = 'NAME1'.

wa_fieldcat-seltext_m = 'Customer Name'.

wa_fieldcat-outputlen = '30'.

APPEND wa_fieldcat TO i_fieldcat.

CLEAR wa_fieldcat.

  • Field For Po Number.

wa_fieldcat-tabname = 'ITAB'.

wa_fieldcat-fieldname = 'BSTKD'.

wa_fieldcat-seltext_m = 'PO No'.

wa_fieldcat-outputlen = '20'.

APPEND wa_fieldcat TO i_fieldcat.

CLEAR wa_fieldcat.

  • Field For Order Value

wa_fieldcat-tabname = 'ITAB'.

wa_fieldcat-fieldname = 'NETWR'.

wa_fieldcat-seltext_m = 'Order Value '.

wa_fieldcat-outputlen = '12'.

APPEND wa_fieldcat TO i_fieldcat.

CLEAR wa_fieldcat.

  • Field For Po Date.

wa_fieldcat-tabname = 'ITAB'.

wa_fieldcat-fieldname = 'BSTDK'.

wa_fieldcat-seltext_m = 'PO Date'.

wa_fieldcat-outputlen = '20'.

APPEND wa_fieldcat TO i_fieldcat.

CLEAR wa_fieldcat.

wa_fieldcat-tabname = 'ITAB'.

wa_fieldcat-fieldname = 'EDATU'.

wa_fieldcat-seltext_m = 'Delivery Date'.

wa_fieldcat-outputlen = '12'.

APPEND wa_fieldcat TO i_fieldcat.

CLEAR wa_fieldcat.

  • Field For Order Qty.

wa_fieldcat-tabname = 'ITAB'.

wa_fieldcat-fieldname = 'KWMENG'.

wa_fieldcat-seltext_m = 'Ord.QTY'.

wa_fieldcat-outputlen = '20'.

APPEND wa_fieldcat TO i_fieldcat.

CLEAR wa_fieldcat.

  • field For Delivery Qty.

wa_fieldcat-tabname = 'ITAB'.

wa_fieldcat-fieldname = 'op_qty'.

wa_fieldcat-seltext_m = 'DEL QTY.'.

wa_fieldcat-outputlen = '20'.

APPEND wa_fieldcat TO i_fieldcat.

CLEAR wa_fieldcat.

  • Field For Open Qty from ITAB.

wa_fieldcat-tabname = 'ITAB'.

wa_fieldcat-fieldname = 'OMENG'.

wa_fieldcat-seltext_m = 'OPEN QTY.'.

wa_fieldcat-outputlen = '20'.

APPEND wa_fieldcat TO i_fieldcat.

CLEAR wa_fieldcat.

    • Field For Pending Weight from ITAB.

  • wa_fieldcat-tabname = 'ITAB'.

  • wa_fieldcat-fieldname = 'BRGEW'.

  • wa_fieldcat-seltext_m = 'Pending Weight'.

  • wa_fieldcat-outputlen = '12'.

  • APPEND wa_fieldcat TO i_fieldcat.

  • CLEAR wa_fieldcat.

      • Field For netweight.

wa_fieldcat-tabname = 'ITAB'.

wa_fieldcat-fieldname = 'NTGEW'.

wa_fieldcat-seltext_m = 'Net Weight'.

wa_fieldcat-outputlen = '20'.

APPEND wa_fieldcat TO i_fieldcat.

CLEAR wa_fieldcat.

    • Field For Actual Delivery.

  • wa_fieldcat-tabname = 'ITAB'.

  • wa_fieldcat-fieldname = 'LFDAT'.

  • wa_fieldcat-seltext_m = 'Actual Delivery'.

  • wa_fieldcat-outputlen = '12'.

  • APPEND wa_fieldcat TO i_fieldcat.

  • CLEAR wa_fieldcat.

wa_fieldcat-tabname = 'ITAB'.

wa_fieldcat-fieldname = 'KBETR'.

wa_fieldcat-seltext_m = 'RATE'.

wa_fieldcat-outputlen = '20'.

APPEND wa_fieldcat TO i_fieldcat.

CLEAR wa_fieldcat.

*

wa_fieldcat-tabname = 'VBUP'.

wa_fieldcat-fieldname = 'LFSTA'.

wa_fieldcat-seltext_m = 'Delivery Status'.

wa_fieldcat-outputlen = '20'.

APPEND wa_fieldcat TO i_fieldcat.

CLEAR wa_fieldcat.

  • Field For pending weight.

wa_fieldcat-tabname = 'ITAB'.

wa_fieldcat-fieldname = 'PENDING_VAL'.

wa_fieldcat-seltext_m = 'Pending VALUE'.

wa_fieldcat-outputlen = '20'.

APPEND wa_fieldcat TO i_fieldcat.

CLEAR wa_fieldcat.

*

ENDFORM. "BUILD_FIELDCATLOG

&----


*& Form fetch_data

&----


  • text

----


FORM fetch_data.

break mtabap.

SELECT *

FROM vbep

INTO TABLE it_vbep

WHERE edatu IN so_edatu

AND vbeln IN so_vbeln.

IF NOT it_vbep[] IS INITIAL.

SELECT *

FROM vbak

INTO TABLE it_vbak

FOR ALL ENTRIES IN it_vbep

WHERE vbeln = it_vbep-vbeln

AND kunnr IN so_kunnr.

ENDIF.

IF NOT it_vbak[] IS INITIAL.

SELECT *

FROM vbpa

INTO TABLE it_vbpa

FOR ALL ENTRIES IN it_vbak

WHERE vbeln = it_vbak-vbeln

AND posnr = space.

SELECT *

FROM vbap

INTO TABLE it_vbap

FOR ALL ENTRIES IN it_vbak

WHERE vbeln = it_vbak-vbeln.

  • Select all Customer Data

SELECT * FROM kna1 INTO TABLE it_kna1

FOR ALL ENTRIES IN it_vbak

WHERE kunnr = it_vbak-kunnr .

SELECT *

FROM vbkd

INTO TABLE it_vbkd

FOR ALL ENTRIES IN it_vbap

WHERE vbeln = it_vbap-vbeln.

  • and posnr = IT_VBAP-POSNR.

SELECT *

FROM vbbe

INTO TABLE it_vbbe

FOR ALL ENTRIES IN it_vbap

WHERE vbeln = it_vbap-vbeln

AND posnr = it_vbap-posnr.

SELECT *

FROM vbup

INTO TABLE it_vbup

FOR ALL ENTRIES IN it_vbap

WHERE vbeln = it_vbap-vbeln

AND posnr = it_vbap-posnr.

SELECT *

FROM konv

INTO TABLE it_konv

FOR ALL ENTRIES IN it_vbak

WHERE knumv = it_vbak-knumv

AND kinak = space .

SELECT *

FROM vbrp

INTO TABLE it_vbrp

FOR ALL ENTRIES IN it_vbak

WHERE aubel = it_vbak-vbeln.

IF NOT it_vbrp[] IS INITIAL.

SELECT * FROM likp

INTO TABLE it_likp

FOR ALL ENTRIES IN it_vbrp

WHERE vbeln = it_vbrp-vgbel.

SELECT * FROM lips

INTO TABLE it_lips

FOR ALL ENTRIES IN it_vbrp

WHERE vbeln = it_vbrp-vgbel

AND posnr = it_vbrp-vgpos.

  • itab-lfimg = it_lips-lfimg.

ENDIF. ENDIF.

LOOP AT it_vbap.

itab-posnr = it_vbap-posnr.

itab-posar = it_vbap-posar.

itab-brgew = it_vbap-brgew.

itab-ntgew = it_vbap-ntgew.

itab-KWMENG = it_vbap-kwmeng.

itab-LFMNG = it_vbap-LFMNG.

itab-LFIMG = it_lips-LFIMG.

itab-op_qty = it_vbap-kwmeng - it_lips-LFIMG.

READ TABLE it_vbak WITH KEY vbeln = it_vbap-vbeln.

itab-vbeln = it_vbak-vbeln.

itab-netwr = it_vbak-netwr.

itab-kunnr = it_vbak-kunnr.

READ TABLE it_vbep WITH KEY vbeln = it_vbap-vbeln.

itab-edatu = it_vbep-edatu.

READ TABLE it_kna1 WITH KEY kunnr = it_vbak-kunnr.

itab-name1 = it_kna1-name1.

READ TABLE it_vbkd WITH KEY vbeln = it_vbap-vbeln .

itab-bstdk = it_vbkd-bstdk.

itab-bstkd = it_vbkd-bstkd.

READ TABLE it_vbrp WITH KEY aubel = it_vbap-vbeln aupos = it_vbap-posnr.

READ TABLE it_lips WITH KEY vbeln = it_vbrp-aubel posnr = it_vbrp-aupos.

itab-delivery = it_lips-vbeln.

  • itab-del_qty = it_lips-lfimg.

  • itab-del_qty = LIPS-LFIMG.

READ TABLE it_likp WITH KEY vbeln = it_vbrp-aubel .

itab-lfdat = it_likp-lfdat.

  • itab-ntgew = it_likp-ntgew.

break mtabap.

READ TABLE it_vbup WITH KEY vbeln = it_vbap-vbeln posnr = it_vbap-posnr.

itab-lfsta = it_vbup-lfsta.

READ TABLE it_vbep WITH KEY vbeln = it_vbap-vbeln posnr = it_vbap-posnr.

itab-wmeng = it_vbap-kwmeng .

itab-bmeng = it_vbep-bmeng.

READ TABLE it_vbbe WITH KEY vbeln = it_vbap-vbeln posnr = it_vbap-posnr.

itab-omeng = it_vbbe-omeng .

READ TABLE it_konv WITH KEY knumv = it_vbak-knumv

kposn = it_vbap-posnr

kschl = 'PR00'.

  • ITAB-KBETR = IT_KONV-KBETR / 10. " CONDITION RATE

itab-kbetr = it_konv-kbetr.

itab-kwert = it_konv-kwert . "CONDITION VALUE

  • itab-pending_val = ITAB-OMENG * ITAB-KWERT .

itab-pending_val = itab-omeng * itab-kbetr .

APPEND itab.

ENDLOOP.

ENDFORM. "data_retrieval

&----


*& Form build_listheader

&----


  • text

----


  • -->IT_LISTHEADER text

----


  • Show quoted text -

FORM build_listheader USING it_listheader TYPE slis_t_listheader.

  • DATA HLINE TYPE SLIS_LISTHEADER.

DATA: ls_line TYPE slis_listheader.

  • bhavesh

  • HLINE-INFO = 'report Developed by Bhavesh'.

  • HLINE-TYP = 'H'.

  • Header

  • Bhavesh

CLEAR ls_line.

ls_line-typ = 'H'.

  • LS_LINE-KEY: not used for this type

ls_line-info = 'Sales ORDER Report'.

APPEND ls_line TO it_listheader.

  • bhavesh

***Selection

CLEAR ls_line.

ls_line-typ = 'S'.

ls_line-key = 'Key 1'.

ls_line-info = 'SFEL'.

APPEND ls_line TO it_listheader.

ls_line-key = 'Key 2'.

ls_line-info = 'SFEL'.

APPEND ls_line TO it_listheader.

***Action

CLEAR ls_line.

ls_line-typ = 'A'.

  • LS_LINE-KEY: not used for this type

ls_line-info = 'Status list'.

APPEND ls_line TO it_listheader.

ENDFORM. "BUILD_LISTHEADER

*ENDFORM. "build_listheader

&----


*& Form display

&----


*& text

*&----


*

FORM display.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

i_callback_program = sy-repid

  • i_callback_top_of_page = 'TOP_OF_PAGE'

is_layout = alv_layout

it_fieldcat = i_fieldcat

  • it_events = gt_events[]

i_callback_user_command = 'USER_COMMAND'

i_grid_title = 'BHAVESH REPORT'

TABLES

t_outtab = itab[].

CLEAR : itab .

ENDFORM. "display

&----


*& Form top_of_page

&----


  • text

----


FORM top_of_page.

CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

EXPORTING

it_list_commentary = it_listheader[].

  • i_logo = 'ENJOYSAP_LOGO'.

  • I_END_OF_LIST_GRID =

ENDFORM. "TOP_OF_PAGE

0 Kudos

Please paste it in a proper format.

You can use the option code( < > ) in the toolbar.

0 Kudos

<<removed_by_moderator>>

mail address is not allowed here.

Edited by: Vijay Babu Dudla on Apr 23, 2009 3:09 AM

0 Kudos

thnks fro reply

OK

Bhavesh

former_member188685
Active Contributor
0 Kudos

The problem is with the fieldcatalog.

wa_fieldcat-tabname = 'ITAB'.
wa_fieldcat-fieldname =  'OP_QTY' .    " 'op_qty'.  <<==it should be CAPS
wa_fieldcat-seltext_m = 'DEL QTY.'.
wa_fieldcat-outputlen = '20'. APPEND
wa_fieldcat TO i_fieldcat.
CLEAR wa_fieldcat.