Application Development and Automation 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: 
Read only

REPORT

Former Member
0 Likes
392

This is lalitha .

1. In my program for a sales order report.

i got an error " field "cursor-field" is unknown .it is neither in one or the spefified tables

Ihave defined as

data: cfield(20)

cvalue(15) .

How should i define "cursor-field" in the program .?

what does a cursor field do ? .

ThankU .

2.if i get an error "The work area is not long enough"

what should i do ?

3. Here's another sales order report .

In my output i'am getting only the column headings.

no data is displayed .

no standard page heading

line-count 25(3)

line-size 200.

*************tables*******

TYPE-POOLS: SLIS .

TABLES: VBAK,

TVLST,

TVFST,

VBUK .

*********DATA TYPE********

TYPES: BEGIN OF TY_HOLD,

VBELN TYPE VBAK-VBELN,

ERDAT TYPE VBAK-ERDAT,

KUNNR TYPE VBAK-KUNNR,

LIFSP TYPE tvlst-lifsp,

FAKSp TYPE tvfst-faksp,

CMGST TYPE VBUK-CMGST,

ltext type tvlst-vtext,

ftext type tvfst-vtext,

cstatus(3) type c,

END OF TY_HOLD .

**************WORK AREA**

DATA: W_HOLD TYPE TY_HOLD .

DATA: T_HOLD TYPE TY_HOLD OCCURS 1 WITH header line.

DATA: FLAG TYPE C .

data: vtext1 type tvlst-vtext .

DATA: VTEXT2 TYPE TVFST-VTEXT.

*********SELECTION SCREEN*****

SELECT-OPTIONS: S_ORDER FOR VBAK-VBELN,

S_CDATE FOR VBAK-ERDAT,

S_CUSTNO FOR VBAK-KUNNR .

******selection screen*********

*at selection-screen .

  • SELECT * FROM VBAK

  • INTO CORRESPONDING FIELDS OF TABLE t_hold

  • WHERE VBELN IN S_ORDER

  • AND ERDAT IN S_CDATE

  • AND KUNNR IN S_CUSTNO .

  • IF NOT t_hold IS INITIAL .

  • SELECT * FROM VBUK

  • INTO CORRESPONDING FIELDS OF TABLE T_HOLD

  • FOR ALL ENTRIES IN T_HOLD

  • WHERE VBELN = t_hold-vbeln.

  • ENDIF .

start-of-selection.

select vbeln

erdat

kunnr

lifsk

faksk

from vbak

into corresponding fields of table t_hold

where vbeln in s_order and erdat in s_cdate

and kunnr in s_custno .

select cmgst from vbuk

into table t_hold

for all entries in t_hold where vbeln = t_hold-vbeln .

LOOP AT T_HOLD into w_hold .

READ TABLE T_HOLD into w_hold WITH KEY VBELN = T_HOLD-VBELN .

IF sy-subrc = 0 .

ENDIF .

IF T_HOLD-Cmgst = 'B' OR

T_HOLD-CMGST = 'C' .

T_HOLD-CMGST = 'YES' .

FLAG = 'X' .

ENDIF .

IF t_hold-lifsp NE SPACE .

SELECT SINGLE VTEXT FROM TVLST

INTO T_HOLD

WHERE LIFSP = T_HOLD-LIFSP .

FLAG = 'X' .

T_HOLD-lifsp = vtext1.

ENDIF .

IF T_HOLD-FAKSp NE SPACE .

SELECT SINGLE VTEXt

FROM TVfst

INTO VTEXT1

WHERE FAKSp = T_HOLD-FAKSp .

FLAG = 'X' .

T_HOLD-faksp = VTEXT2 .

ENDIF .

IF FLAG = 'X' .

APPEND T_HOLD .

CLEAR T_hold .

ENDIF .

write: /03 'SALES ORDER NO',

20 'CREATED DATE',

35 'CUSTOMER NO',

50 'DELIVERY BLOCK',

75 'BILLING BLOCK',

100 'CREDIT STATUS'.

ULINE .

WRITE: /03 w_HOLD-VBELN,

20 w_HOLD-ERDAT,

35 w_HOLD-KUNNR,

50 w_hold-ltext,

75 w_hold-ftext,

100 w_hold-cstatus .

ENDLOOP .

uline .

4. In a sales order how can we find out that the order is in 'open '

/ hold .

5. If the salesorder is in open then

how can we declare in extract data in our report ?

6. if the salesorder is in hold then

how can we decalte in extract data in out report ?

.

1 ACCEPTED SOLUTION
Read only

former_member195698
Active Contributor
0 Likes
335

1) Provide the details of the Code

2) You might be moving data into a work area with Incompatible structure.

3) The code seems to have lot of issues. YOu are moving the data from VBUK into the same table T_HOLD..(Your VBAK data is also moved into same table).

select cmgst from vbuk

into table t_hold

for all entries in t_hold where vbeln = t_hold-vbeln .(This query is wrong)

LOOP AT T_HOLD into w_hold .

READ TABLE T_HOLD into w_hold WITH KEY VBELN = T_HOLD-VBELN .

IF sy-subrc = 0 .

ENDIF .

(This logic is also wrong ).....

1 REPLY 1
Read only

former_member195698
Active Contributor
0 Likes
336

1) Provide the details of the Code

2) You might be moving data into a work area with Incompatible structure.

3) The code seems to have lot of issues. YOu are moving the data from VBUK into the same table T_HOLD..(Your VBAK data is also moved into same table).

select cmgst from vbuk

into table t_hold

for all entries in t_hold where vbeln = t_hold-vbeln .(This query is wrong)

LOOP AT T_HOLD into w_hold .

READ TABLE T_HOLD into w_hold WITH KEY VBELN = T_HOLD-VBELN .

IF sy-subrc = 0 .

ENDIF .

(This logic is also wrong ).....