‎2006 Jun 07 5:00 PM
hi all,
i have created screen which has 3 fields deliveryno, BOL, vendor no.
in pai module i have written following code. program is module pool. when i run he tcode for it and enter data its not updating it.
PROGRAM ZFREIGHT2 .
tables: zfreight.
data: zucomm like sy-ucomm.
&----
*& Module USER_COMMAND_1000 INPUT
&----
text
----
MODULE USER_COMMAND_1000 INPUT.
data: deliveryno type c,
bol type c,
vendorno type c.
if zucomm ='savecode'.
zfreight-zvbeln = deliveryno.
zfreight-zbolnr = bol.
zfreight-zlifnr = vendorno.
modify zfreight.
MESSAGE E001(Z00).
Data saved successfully.
endif.
ENDMODULE. " USER_COMMAND_1000 INPUT
‎2006 Jun 07 5:02 PM
hi Amol,
Put a break point at <b>zucomm</b>ie.zucomm = sy-ucom and press F8(execute)
Regards,
Santosh
‎2006 Jun 07 5:12 PM
hi santosh,
i did as u said, when executed it executes till <b>zucomm ='savecode'.</b> here and comes out of loop.
‎2006 Jun 07 5:16 PM
That's because zucomm is not populated, add zucomm to the screen element list in the General attr..
Regards
Sridhar
‎2006 Jun 07 5:18 PM
hi Amol,
Have u added this statement before that i.,e <b>zucomm = sy-ucomm</b>. if not add that one.
the other probablity could be you might not have you assigned the button name as <b>'savecode'</b> to the button??.
Regards,
Santosh
‎2006 Jun 07 5:35 PM
‎2006 Jun 07 5:03 PM
Make the highlighted changes:
<b>zucomm = sy-ucomm.
if zucomm ='SAVECODE'.</b>
zfreight-zvbeln = deliveryno.
zfreight-zbolnr = bol.
zfreight-zlifnr = vendorno.
modify zfreight.
MESSAGE E001(Z00).
Data saved successfully.
endif.
Regards,
Ravi
‎2006 Jun 07 5:04 PM
HI AMOL,
zfreight-zvbeln = deliveryno.(GIVE THE NAME OF THE FIELD U HAVE SPECIFIED IN SE51)
zfreight-zbolnr = bol.
zfreight-zlifnr = vendorno.
modify zfreight.
‎2006 Jun 07 5:05 PM
Hii
case sy-ucomm .
when 'savecode'.
zfreight-zvbeln = deliveryno.
zfreight-zbolnr = bol.
zfreight-zlifnr = vendorno.
modify zfreight.
MESSAGE E001(Z00).
* Data saved successfully.
endif.
endcase.Regards
Naresh
‎2006 Jun 07 5:06 PM
Hi,
ok code should be in caps...
zucomm = sy-ucomm.
<b>if zucomm ='SAVECODE'.</b>
zfreight-zvbeln = deliveryno.
zfreight-zbolnr = bol.
zfreight-zlifnr = vendorno.
modify zfreight.
MESSAGE E001(Z00).
* Data saved successfully.Regards
vijay
‎2006 Jun 07 5:07 PM
Did you add field zucomm as the ok code field in the screen element list?
usually last field in the element list.
Regards
Sridhar