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

Error

Former Member
0 Likes
735

Hi,

This is my program, what is choise in the importing(In bold letters in the program). I am getting error that w_index is missing. Plz let me know why we give choise.

&----


*& Module Pool ZMP_TAB6

*&

&----


*&

*&

&----


PROGRAM ZMP_TAB6.

TABLES:

VBAK.

TYPES:

BEGIN OF TY_VBELN,

VBELN TYPE VBAK-VBELN,

END OF TY_VBELN.

DATA:

IT_VBELN TYPE TABLE OF TY_VBELN.

&----


*& Module USER_COMMAND_9001 INPUT

&----


  • text

----


MODULE USER_COMMAND_9001 INPUT.

IF SY-UCOMM EQ 'EXIT'.

LEAVE PROGRAM.

ENDIF.

IF VBAK-KUNNR IS NOT INITIAL.

SELECT VBELN FROM VBAK INTO TABLE IT_VBELN

WHERE KUNNR EQ VBAK-KUNNR.

IF SY-SUBRC NE 0.

MESSAGE S000(0) WITH 'NO DATA FOUND'.

ELSE.

CALL FUNCTION 'POPUP_WITH_TABLE_DISPLAY'

EXPORTING

ENDPOS_COL = 30

ENDPOS_ROW = 10

STARTPOS_COL = 5

STARTPOS_ROW = 5

TITLETEXT = 'SELECT VALUE'

IMPORTING

<b>CHOISE = W_INDEX</b>

TABLES

VALUETAB = IT_VBELN

EXCEPTIONS

BREAK_OFF = 1

OTHERS = 2

.

IF SY-SUBRC <> 0.

READ TABLE IT_VBELN INTO VBAK-VBELN INDEX W_INDEX.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

ENDMODULE. " USER_COMMAND_9001 INPUT

Thanks,

Ram

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
714

Hi, you have to declare your data :

DATA : w_index TYPE sytabix.

Regards,

Mathieu

5 REPLIES 5
Read only

Former Member
0 Likes
715

Hi, you have to declare your data :

DATA : w_index TYPE sytabix.

Regards,

Mathieu

Read only

0 Likes
714

Hi,

plz let me know what is choise and why we declare there.

Read only

0 Likes
714

CHOISE will give you the line number of the entry you have selected in the pop-up.

Please mark points if the solution was useful.

Regards,

Manoj

Read only

0 Likes
714

<b>Choise</b> is the return of your function.

This function allows you to pop up a list in which the user select a line.

The result of the function, is the index of the selected line.

If you want to know the data selected, you just have to do :

READ TABLE it_VEBLN INDEX w_index.

Read only

seshatalpasai_madala
Product and Topic Expert
Product and Topic Expert
0 Likes
714

HI,


*&---------------------------------------------------------------------*
*& Module Pool ZMP_TAB6
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

PROGRAM ZMP_TAB6.
TABLES:
VBAK.
TYPES:
BEGIN OF TY_VBELN,
VBELN TYPE VBAK-VBELN,
END OF TY_VBELN.
DATA:
IT_VBELN TYPE TABLE OF TY_VBELN.

DATA: W_INDEX LIKE SY-TABIX. "declared the w_index

*&---------------------------------------------------------------------*
*& Module USER_COMMAND_9001 INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE USER_COMMAND_9001 INPUT.
IF SY-UCOMM EQ 'EXIT'.
LEAVE PROGRAM.
ENDIF.
IF VBAK-KUNNR IS NOT INITIAL.
SELECT VBELN FROM VBAK INTO TABLE IT_VBELN
WHERE KUNNR EQ VBAK-KUNNR.
IF SY-SUBRC NE 0.
MESSAGE S000(0) WITH 'NO DATA FOUND'.
ELSE.

CALL FUNCTION 'POPUP_WITH_TABLE_DISPLAY'
EXPORTING
ENDPOS_COL = 30
ENDPOS_ROW = 10
STARTPOS_COL = 5
STARTPOS_ROW = 5
TITLETEXT = 'SELECT VALUE'
IMPORTING
CHOISE = W_INDEX
TABLES
VALUETAB = IT_VBELN
EXCEPTIONS
BREAK_OFF = 1
OTHERS = 2
.
IF SY-SUBRC <> 0.
READ TABLE IT_VBELN INTO VBAK-VBELN INDEX W_INDEX.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

ENDMODULE. " USER_COMMAND_9001 INPUT

Regards,

Sesh