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

module programming issue ?

Former Member
0 Likes
302

First Screen – 100 ( single box to enter the reservation no: RKPF-RSNUM)

Based on this reservation design next screen (200) showing the reservation header (Table - RKPF) with 5 fields only (RSNUM, RSDAT, USNAM, BWART, WEMPF) and below that a item (Table – RESB) area where all the items shud be displayed in a table control (with the following fields only – RSPOS, MATNR, LGORT, BDMNG, MEINS, ENWRT, (a calculated field say x = BDMNG minus ENWRT).

could any1 tell me the complete steps n wht all should i code in pbo n pai?

please write the code.

PLEASE REPLY ASAP.

REGARDS

Essam

essamsaud@yahoo.co.in

1 REPLY 1
Read only

Former Member
0 Likes
273

Hi,

I ll give you the basic steps, try using this code .....


*for screen 100

PROCESS BEFORE OUTPUT.
  MODULE STATUS_0100.

PROCESS AFTER INPUT.
  MODULE CANCEL AT EXIT-COMMAND.
  module user_command_0100.

*for screen 200.
PROCESS BEFORE OUTPUT.
  MODULE STATUS_0200.
      LOOP AT ITAB2 WITH CONTROL reservation.
    ENDLOOP. 

PROCESS AFTER INPUT.
  MODULE CANCEL1 AT EXIT-COMMAND.
  LOOP AT ITAB2.
  ENDLOOP.
  module user_command_0200.


MODULE status_0100 OUTPUT.
  SET PF-STATUS 'SCREEN_100'.
ENDMODULE.

MODULE cancel INPUT.
  LEAVE PROGRAM.
ENDMODULE.

MODULE user_command_0100 INPUT.
  save_ok = ok_code.
  CLEAR ok_code.
  CASE save_ok.
    WHEN 'DETAIL'.
        CALL SCREEN 200.
  ENDCASE.
ENDMODULE.

MODULE STATUS_0200 OUTPUT.
  SET PF-STATUS 'SCREEN_200'.
select RSNUM RSDAT USNAM BWART WEMPF into table itab1 from
resb where rsnum = p_rsnum.
read table itab1 index 1.
p_rsdat = itab1-rsdat.
p_usnam = itab1-usnam.
p_bwart = itab1-bwart.
p_wempf = itab1-wempf.
select RSPOS, MATNR, LGORT, BDMNG, MEINS, ENWRT into corresponding fields of table itab2 table resb where rsnum = p_rsnum.
loop at itab2.
itab2-x = itab2-BDMNG - itab2-ENWRT.
modify itab2 index sy-tabix.
endloop.
ENDMODULE.

MODULE CANCEL1 INPUT.
 LEAVE PROGRAM.
ENDMODULE.

Happy coding ...

Regards,

SJ