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: 

module pool-table control

Former Member
0 Kudos

hai.

i am doing module pool program.

in this i need to create 2screens.

one for input and the other for output.

in the input screen i have 3 fields from 2 diff standard tables and a push button(display).

in the output screen i have created a table control with 7fields from 3diff tables and certain push buttons.

after giving the input if i click on the push button (display) it must go to the output screen and display all the relevant fields in the output screen of the table control.

after it displays the fields, i must be able to change, delete and merge fields. these changes must be updated even in the standard tables.

can someone pleaseeeee help me out with this.

i need step wise procedure for this as i am doing my 1st object in module pool.

with regards

-Sunitha.S

4 REPLIES 4

Former Member
0 Kudos

Hi Sunitha,

When you enter the details in the input screen and press the push button(display),inorder to navigate to the output screen, you need to write a code for this in a PAI module of the input screen.The code for this would be.

case SY-UCOMM.

when 'DISPLAY'.

call screen 200. *** 200 is the screen number of the output screen***

endcase.

and inorder to display all the relevant fields in the table control in the output screen,you need to write a select querry which would get all the relevant details required into an internal table.This internal table is used for the table control.

The select querry needs to be written in the PBO of the output screen.The code will be :

SELECT * INTO CORRESPONDING FIELDS OF ITAB FROM Z84433_MOVIE INNER JOIN

Z84433_BOOKING ON Z84433_MOVIEMOV_CODE = Z84433_BOOKINGMOV_CODE .

ENDSELECT.

Here in the select querry, itab is the name of the internal table which is used for the table control.So when the internal table is populated,the details would automatically be visible in the table control in the output screen. As u can see in the select querry above, the details are being populated from two Z tables.Here an inner join has to be used inorder to match with the details in all the talbes and in the where condition the entered value in the first screen is checked with the value present in the reference table.

You can then change the values in the table control and to update those fields in the reference tables,the following code has to be written in a PAI module of the output screen.

This code works when a push button save is pressed in the output screen.The button has to be created.

case SY-UCOMM.

when "SAVE'.

LOOP AT itab. "itab is the internal table used for the table control.

ztm09_ekpo-ebeln = ztm09_ekko-ebeln. "ztm09_ekko and ztm09_ekpo are the names of the Z Tables.

ztm09_ekpo-ebelp = tb_line-ebelp.

ztm09_ekpo-matnr = tb_line-matnr.

ztm09_ekpo-menge = tb_line-menge.

ztm09_ekpo-meins = tb_line-meins.

ztm09_ekpo-netpr = tb_line-netpr.

ztm09_ekpo-waers = tb_line-waers.

*****Update the entries into item table*****

MODIFY ztm09_ekpo.

ENDLOOP.

Reward if helpfull

Thanks,

Kashyap Ivaturi

Edited by: Kashyap Ivaturi on Jan 2, 2008 3:50 PM

0 Kudos

hi sir,

sir thanks for the help..

but sir the coding u have sent is for updating z tables.

our requirement is to update the standard tables it self.

INPUT

Plant (WERKS)

MRP Controller (MARC-DISPO)

DATE

OUT PUT

WORK SCHEDULE NO: MERGE(push button)

PLANNED ORDER NO

MATERIAL NO

MATERIAL DESCRIPTION

QUANTITY

SET

PRIORITY

WORK SCHEDULE NO: should be taken from req plan number (PLAF/PBIM-PBDNR)

PLANNED ORDER NO (PLAF-PLNUM)

MATERIAL NUMBER (PLAF-MATNR)

MATERIAL DESCRIPTION

QUANTITY (PLAF-GSMNG)

SET: here provision should be given to enter the numeric value (default it should be 1)

PRIORITY: provision should be given to enter the numeric value

MERGE: this can be a push button, which is used to merge two planned orders into one

Our objective is to create a customized screen in which user can change the planned orders. System should display the existing planned orders list and should be allowed to change the quantity, delete the planned order and create new planned order (change the material). It should also firm the parent planned order

sir please help me with this.

0 Kudos

Hai

Input u enter the 3 three values .

First compare the Date with Work Schedule number then taken that work schedule number compare with palnned order .

This way u do ?

0 Kudos

Hi Sunitha,

To update the standard SAP tables, you will need to have an access key.

But it is not usually done as the values that you want to change might dependant on many other tables which might be a problem.

But to change the values in a table,you will have to use BDC,BAPI,LSMW or a transaction code where in you can modify data in a standard table.

I think the BAPI to change a planned order is BAPI_PLANNEDORDER_CHANGE.

You can also change the values in a standard table by using a MODIFY statement.

But in order to change the values in the standard table,you need the access key.

It is not advisable to change a standard table in general for the reasons mentioned above.

Thanks,

Kashyap Ivaturi