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: 

At User Command

Former Member
0 Kudos

Hi,

Iam getting the error in my program. This is my program. I am getting the error in the bold ones.

First one is it is not accepting VBELN, When i remove VBELN it is taking.

second error is "FIELD ... ." expected after "FILLED".

Plz correct me.

REPORT ZAC_TAB24 LINE-SIZE 180

LINE-COUNT 26(2)

NO STANDARD PAGE HEADING.

TYPES:

BEGIN OF TY_KNA1,

KUNNR TYPE KNA1-KUNNR,

LAND1 TYPE KNA1-LAND1,

NAME1 TYPE KNA1-NAME1,

ORT01 TYPE KNA1-ORT01,

END OF TY_KNA1,

BEGIN OF TY_VBAK,

VBELN TYPE VBAK-VBELN,

AUDAT TYPE VBAK-AUDAT,

AUART TYPE VBAK-AUART,

NETWR TYPE VBAK-NETWR,

END OF TY_VBAK,

BEGIN OF TY_VBAP,

POSNR TYPE VBAP-POSNR,

MATNR TYPE VBAP-MATNR,

ARKTX TYPE VBAP-ARKTX,

NETPR TYPE VBAP-NETPR,

NETWR TYPE VBAP-NETWR,

END OF TY_VBAP.

DATA:

ST_KNA1 TYPE TY_KNA1,

IT_KNA1 TYPE TABLE OF TY_KNA1,

ST_VBAK TYPE TY_VBAK,

IT_VBAK TYPE TABLE OF TY_VBAK,

ST_VBAP TYPE TY_VBAP,

IT_VBAP TYPE TABLE OF TY_VBAP.

  • S E L E C T O P T I O N S.

SELECT-OPTIONS:

SKUNNR FOR ST_KNA1-KUNNR.

  • S T A R T O F S E L E C T I O N.

START-OF-SELECTION.

PERFORM GET_CUSTDATA.

IF IT_KNA1 IS NOT INITIAL.

SET PF-STATUS 'ZSTAT1'.

LOOP AT IT_KNA1 INTO ST_KNA1.

WRITE:/ ST_KNA1-KUNNR,ST_KNA1-LAND1,ST_KNA1-NAME1,ST_KNA1-ORT01.

ENDLOOP.

ELSE.

WRITE:/ 'NO CUSTOMERS FOUND'.

ENDIF.

  • AT USER-COMMAND.

<b>AT USER-COMMAND.

CASE SY-UCOMM.

WHEN 'SALES'.

SELECT VBELN AUDAT AUART NETWR FROM VBAK

INTO TABLE IT_VBAK

WHERE KUNNR EQ ST_KNA1-KUNNR.

IF SY-SUBRC EQ 0.

LOOP AT IT_VBAK INTO ST_VBAK.

WRITE:/ ST_VBAK-VBELN,ST_VBAK-AUDAT,ST_VBAK-AUART,ST_VBAK-NETWR.

ENDLOOP.

ENDIF.

WHEN'BANK'.

WRITE:/ 'BANK DETAILS'.

WHEN 'CHANGE'.

CALL TRANSACTION 'XD02'.

SET PARAMETER ID "KUN".

FILLED ST_KNA1-KUNNR.

ENDCASE.</b>

  • A T L I N E S E L E C T I O N.

AT LINE-SELECTION.

CASE SY-LSIND.

WHEN 1.

WRITE:/ SY-LISEL.

SELECT VBELN AUDAT AUART NETWR FROM VBAK

INTO TABLE IT_VBAK

WHERE KUNNR EQ ST_KNA1-KUNNR.

IF SY-SUBRC EQ 0.

LOOP AT IT_VBAK INTO ST_VBAK.

WRITE:/ ST_VBAK-VBELN,ST_VBAK-AUDAT,ST_VBAK-AUART,ST_VBAK-NETWR.

HIDE ST_VBAK.

ENDLOOP.

ELSE.

MESSAGE S000(0) WITH 'NO RECORDS FOUND FOR THIS CUSTOMER'.

ENDIF.

WHEN 2.

WRITE:/ SY-LISEL.

SELECT POSNR MATNR ARKTX NETPR NETWR FROM VBAP INTO TABLE IT_VBAP.

IF SY-SUBRC EQ 0.

LOOP AT IT_VBAP INTO ST_VBAP.

WRITE:/ ST_VBAP-POSNR,ST_VBAP-MATNR,ST_VBAP-ARKTX,ST_VBAP-NETPR,ST_VBAP-NETWR.

HIDE ST_VBAP.

ENDLOOP.

ELSE.

MESSAGE S000(0) WITH 'NO ITEMS FOUND FOR THIS DOCUMENT NUMBER'.

ENDIF.

ENDCASE.

  • T O P O F P A G E D U R I N G L I N E S E L E C T I O N.

TOP-OF-PAGE DURING LINE-SELECTION.

CASE SY-LSIND.

WHEN 1.

WRITE:/ 'SALES DOCUMENT DETAILS'.

ULINE.

WHEN 2.

WRITE:/ 'ITEM DETAILS'.

ULINE.

ENDCASE.

&----


*& Form GET_CUSTDATA

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM GET_CUSTDATA .

SELECT KUNNR LAND1 NAME1 ORT01 FROM KNA1 INTO TABLE IT_KNA1

WHERE KUNNR IN SKUNNR.

ENDFORM. " GET_CUSTDATA

Thanks

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Plz keep the SET PARAMETER ID in Single Quotes.

CALL TRANSACTION 'XD02'.

SET PARAMETER ID 'KUN' FIELD ST_KNA1-KUNNR.

ENDCASE.

<b>Reward Points if helpful,</b>

Harish

5 REPLIES 5

Former Member
0 Kudos

Change this part of the code else copy paste.

<b>CALL TRANSACTION 'XD02'.

SET PARAMETER ID 'KUN'

FIELD ST_KNA1-KUNNR.

ENDCASE.

</b>

Regards,

Pavan

0 Kudos

Hi,

This is what i maintained,

still iam getting the error .

CALL TRANSACTION 'XD02'.

SET PARAMETER ID "KUN".

FIELD ST_KNA1-KUNNR.

ENDCASE.

Error is "FIELD ... ." expected after "FIELD".

Former Member
0 Kudos

Plz keep the SET PARAMETER ID in Single Quotes.

CALL TRANSACTION 'XD02'.

SET PARAMETER ID 'KUN' FIELD ST_KNA1-KUNNR.

ENDCASE.

<b>Reward Points if helpful,</b>

Harish

gopi_narendra
Active Contributor
0 Kudos

write like this

SET PARAMETER ID 'KUN' FIELD st_kna1-kunnr.

" KUN in single quotes and field statement in same line

Regards

Gopi

varma_narayana
Active Contributor
0 Kudos

Hi Observe the changes in BOLD.

WHEN 'CHANGE'.

<b>SET PARAMETER ID 'KUN' FIElD ST_KNA1-KUNNR.

CALL TRANSACTION 'XD02' and skip first screen.</b>

ENDCASE.

<b>reward if helpful.</b>