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: 

Hi

Former Member
0 Kudos

Hi,

This is my module pool program.

I had some doubts in the program.

Please tell me the usage of these two rows in this program(Bold letters).

W_ITEM TYPE EBELP.

ZPURI-EBELN = ZPURH-EBELN.

&----


*& Module Pool ZMP_TAB4

*&

&----


*&

*&

&----


PROGRAM ZMP_TAB4.

TABLES:

ZPURH,

ZPURI.

DATA:

IT_PURI TYPE TABLE OF ZPURI,

W_LINES TYPE I,

<b>W_ITEM TYPE EBELP.</b>

CONTROLS:

C1 TYPE TABLEVIEW USING SCREEN 9001.

&----


*& Module USER_COMMAND_9001 INPUT

&----


  • text

----


MODULE USER_COMMAND_9001 INPUT.

CASE SY-UCOMM.

WHEN 'EXIT'.

LEAVE PROGRAM.

WHEN 'ADD'.

<b>ZPURI-EBELN = ZPURH-EBELN.</b>

W_LINES = LINES( IT_PURI ).

W_ITEM = ( W_LINES + 1 ) * 10.

ZPURI-EBELP = W_ITEM.

CALL SCREEN '9002'.

ENDCASE.

ENDMODULE. " USER_COMMAND_9001 INPUT

&----


*& Module USER_COMMAND_9002 INPUT

&----


  • text

----


MODULE USER_COMMAND_9002 INPUT.

CASE SY-UCOMM.

WHEN 'OKAY'.

APPEND ZPURI TO IT_PURI.

CLEAR ZPURI.

LEAVE TO SCREEN 0.

WHEN 'CANCEL'.

CLEAR ZPURI.

LEAVE TO SCREEN 0.

ENDCASE.

ENDMODULE. " USER_COMMAND_9002 INPUT

1 ACCEPTED SOLUTION

gopi_narendra
Active Contributor
0 Kudos

W_ITEM TYPE EBELP. EBELP is the Purchase Document Number . So w_item is a variable of type EBELP.

ZPURI-EBELN = ZPURH-EBELN. Moving the value of ZPURH-EBELN to the variable ZPURI-EBELN. seeing the code ZPURH ZPURI are z tables and the fields EBELN of both the tables seems to be the screen fields, but not any internal tables nor work areas.

ZPURI-EBELN & ZPURH-EBELN are the screen fields.

Regards

Gopi

4 REPLIES 4

Former Member
0 Kudos

EBELP purchasing document number

EBELN item number of purchase doc

Former Member
0 Kudos

Hi,

<b>W_ITEM TYPE EBELP.</b>

This will create a workarea of type EBELP.

<b>ZPURI-EBELN = ZPURH-EBELN.</b>

Regarding this one, u can see TABLES statement in the begining of the program.

When u declare something with TABLES statement this will create a workarea of that table type.

So ZPURI and ZPURH are tables this will create a workareas of type, ZPURI and ZPURH. And EBELN is common in both tables that is why they are assigning the value of ZPURH-EBELN to ZPURI-EBELN.

Thanks & Regards

Santhosh

Former Member
0 Kudos

Hi rams,

Before ZPURI-EBELN = ZPURH-EBELN.

there should be a select statement to get the records from ZPURH table.

Regards

Arun

gopi_narendra
Active Contributor
0 Kudos

W_ITEM TYPE EBELP. EBELP is the Purchase Document Number . So w_item is a variable of type EBELP.

ZPURI-EBELN = ZPURH-EBELN. Moving the value of ZPURH-EBELN to the variable ZPURI-EBELN. seeing the code ZPURH ZPURI are z tables and the fields EBELN of both the tables seems to be the screen fields, but not any internal tables nor work areas.

ZPURI-EBELN & ZPURH-EBELN are the screen fields.

Regards

Gopi