Skip to Content
0
Former Member
Dec 21, 2006 at 06:54 AM

Dear Abapers..

15 Views

Hi all ,

Here iam having 1 header table and 1 item table fields in the screen of module pool. now i can insert display and change all fields of the screen.But i can not insert( dissplay change )multiple line items in the table control in the screen .

Here iam attaching my code pls go through it an dlet me know where iam wrong.

Screen 100 code:

PROCESS BEFORE OUTPUT.

loop at itab1 with control vcontrol.

MODULE STATUS_0100.

endloop.

*

PROCESS AFTER INPUT.

loop at itab1.

MODULE USER_COMMAND_0100.

endloop.

module use-exit.

-


PAI &PBO CODE

-


PROGRAM ZEST_HEADER1.

Tables:zestheader,zestdetails.

controls: vcontrol type tableview using screen'100'.

data:itab like zestheader occurs 0 with header line.

data: itab1 like zestdetails occurs 0 with header line.

*DATA: ESTNR LIKE ZESTHEADER-ESTMATE_NBR.

&----


*& Module USER_COMMAND_0100 INPUT

&----


  • text

----


MODULE USER_COMMAND_0100 INPUT.

case sy-ucomm.

when 'SAVE'.

MOVE zestheader to itab.

itab-COMPANY = ZESTHEADER-COMPANY.

ITAB-ESTMATE_NBR = ZESTHEADER-ESTMATE_NBR.

ITAB-VERSION = ZESTHEADER-VERSION.

ITAB-ESTIMATE_DT = ZESTHEADER-ESTIMATE_DT.

ITAB-TOT_AMT = ZESTHEADER-TOT_AMT.

ITAB-CUST_ID = ZESTHEADER-CUST_ID.

ITAB-WBS_ELEMENT = ZESTHEADER-WBS_ELEMENT.

ITAB-ESTIMATE_STATUS = ZESTHEADER-ESTIMATE_STATUS.

ITAB-USER_FLD1 = ZESTHEADER-USER_FLD1.

ITAB-USER_FLD2 = ZESTHEADER-USER_FLD2.

ITAB-APPROVAL_STATUS = ZESTHEADER-APPROVAL_STATUS.

ITAB-LASTUPDATE_DTM = ZESTHEADER-LASTUPDATE_DTM.

ITAB-LASTUPDATE_USRID = ZESTHEADER-LASTUPDATE_USRID.

append itab.

insert into zestheader values itab.

  • Inserting Details data.

move zestdetails to itab1.

itab1-COMPANY = zestheader-COMPANY.

itab1-ESTMATE_NBR = zestheader-ESTMATE_NBR.

itab1-VERSION = zestheader-VERSION.

itab1-LINE_NO = zestdetails-LINE_NO.

itab1-LINE_STATUS = zestdetails-LINE_STATUS.

itab1-SALES_MATNR = zestdetails-SALES_MATNR.

itab1-UOM = zestdetails-UOM.

itab1-QTY = zestdetails-QTY.

itab1-UNIT_PRICE = zestdetails-UNIT_PRICE.

itab1-AMOUNT = zestdetails-AMOUNT.

itab1-PRICE_TYPE = zestdetails-PRICE_TYPE.

itab1-COMMENTS = zestdetails-COMMENTS.

append itab1.

insert into zestdetails values itab1.

***************************************************

if sy-subrc eq 0.

message s000(0) with 'Estimate Document Created'.

else.

message S000(1) with 'Estimate Not created'.

endif.

endcase.

ENDMODULE. " USER_COMMAND_0100 INPUT

&----


*& Module STATUS_0100 OUTPUT

&----


  • text

----


MODULE STATUS_0100 OUTPUT.

SET PF-STATUS 'ZESTCREATE1'.

SET TITLEBAR 'ZCRET1'.

ENDMODULE. " STATUS_0100 OUTPUT

&----


*& Module use-exit INPUT

&----


  • text

----


MODULE use-exit INPUT.

case sy-ucomm.

when 'EXIT'.

leave program.

endcase.

ENDMODULE. " use-exit INPUT