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

help to debugg code--urgent

Former Member
0 Likes
974

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

10 REPLIES 10
Read only

Former Member
0 Likes
939

hi Amol,

Put a break point at <b>zucomm</b>ie.zucomm = sy-ucom and press F8(execute)

Regards,

Santosh

Read only

0 Likes
939

hi santosh,

i did as u said, when executed it executes till <b>zucomm ='savecode'.</b> here and comes out of loop.

Read only

0 Likes
939

That's because zucomm is not populated, add zucomm to the screen element list in the General attr..

Regards

Sridhar

Read only

0 Likes
939

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

Read only

0 Likes
939

hi santosh,

how do i do this

Read only

Former Member
0 Likes
939

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

Read only

Former Member
0 Likes
939

HI AMOL,

zfreight-zvbeln = deliveryno.(GIVE THE NAME OF THE FIELD U HAVE SPECIFIED IN SE51)

zfreight-zbolnr = bol.

zfreight-zlifnr = vendorno.

modify zfreight.

Read only

Former Member
0 Likes
939

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

Read only

Former Member
0 Likes
939

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

Read only

sridhar_k1
Active Contributor
0 Likes
939

Did you add field zucomm as the ok code field in the screen element list?

usually last field in the element list.

Regards

Sridhar