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

Comp name and Ip add. only in debugging?

Former Member
0 Likes
7,068

i have added some code...in tcode MB21.

so that the comp name and the ip  address  of the comupter

creating reservation could be tracked!

my code is inside the include >>MM07RFF0

i have coded few function modules in a perform.

What i am facing the issue is:

if i place the BREAK-POINT inside the code, (or i debug the placed code)

then the code works perfectly fine.

ip and comp terminal name gets stored in DB Table.

on the other hand, if i remove all the break-points and dont debug,

then, this code is indeed fired(i am pretty sure becoz i have placed one message inside it).

but the comp name and ip address does not gets stored in DB Table.

1 entry which i have marked in screen shot is the scenario..which i debugged!.


i have used these 2 function modules.

I am Literally Confused and have no idea why this is happening.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
7,009

Hi Abhishek,

Use statement WAIT UP TO '1' SEC before update syntax. It will update the values in db table.

Regards,

Supriya.

i have added some code...in tcode MB21.

so that the comp name and the ip  address  of the comupter

creating reservation could be tracked!

my code is inside the include >>MM07RFF0

i have coded few function modules in a perform.

What i am facing the issue is:

if i place the BREAK-POINT inside the code, (or i debug the placed code)

then the code works perfectly fine.

ip and comp terminal name gets stored in DB Table.

on the other hand, if i remove all the break-points and dont debug,

then, this code is indeed fired(i am pretty sure becoz i have placed one message inside it).

but the comp name and ip address does not gets stored in DB Table.

1 entry which i have marked in screen shot is the scenario..which i debugged!.


i have used these 2 function modules.

I am Literally Confused and have no idea why this is happening.

23 REPLIES 23
Read only

FredericGirod
Active Contributor
0 Likes
7,009

Hi,

are you sure your program used a DIALOG process ? 

when you remove the BREAK POINT, did you run the program ? or that was a user ?  if yes, are you sure about authorization ?

regards

Fred

Read only

0 Likes
7,009

are you sure your program used a DIALOG process ?

i am not sure about whether its a dialog process or not. infact i dont know how to check that or what does that mean.Can u shed some more light on that!

when you remove the BREAK POINT, did you run the program ? or that was a user ?  if yes, are you sure about authorization ?

indeed, i had executed the program multiple times, see the table screen-shot,these all reservation have been created by me only, only one entry in which u can see the comp name and ip address...that reservation i debugged my code by putting break-point.

Read only

0 Likes
7,009

For the first point, if you used for example Good issue in VL32n, SAP will prepare all the data, and when it saves the data, that's occurs in background mode. So there is not anymore a computer associated to the process.

a simple test could show you that : instead of a computer name, try to put the content of SY-BATCH

if X, you are in background.

Read only

0 Likes
7,009

i have checked the value of SY-BATCH when the break-point gets fired!

and it is BLANK.

I am still banging my head on my desk

Read only

0 Likes
7,009

you are in debug ...

do it without debug

and put the value into your table

fred

Read only

0 Likes
7,009

I have removed break-points. and checked the value of SY-BATCH (not in debug)

i have placed a message of TYPE 'I' so that i can check the value of SY-BATCH.

BUT the value is still initial.

this also proves that the code is getting triggered!

Read only

0 Likes
7,009

I have set a system break point to try to find what's going on ..

and when I tried to create a view I have stop in this break (I forget to remove it)

I see this code

* COMMIT in (classic) update task?

  call function 'TH_USER_INFO'

    importing

      task_state = i.

  %_task_state = i.

  j = task_vb. x4 = j.

  if not %_task_state z x4.            "update task must not be active

    l_update_task = 'X'.

  endif.

first, SAP didn't specify username ... client ..

and you could find if your are in update task .. (I think not)

could you try the SAP way ?

Read only

0 Likes
7,009

it would be very kind of you fedrik, if u kindly explain what u r trying to say,

i have made some changes in the declaration of function module,

correct me if i am getting u wrong.

Read only

0 Likes
7,009

I'm sorry, my english teacher try to prevent me about the problem I will have ... but .. she failed

remove the client & user in the exporting part

Fred

Read only

0 Likes
7,009

still nothing

i'll get fired... today

and still nothing is captured..

Read only

0 Likes
7,009

arf

did you try to put a break point with a condition after the call of the function ?

if v_terminal eq space.

break-point.

endif.

Read only

0 Likes
7,009

thanks fredric for your continuous efforts.

finally the statement came out as a life saver for me

WAIT UP TO '1' SEC .

all i want to know, the magic behind this statement!

Read only

0 Likes
7,009

I'm little bit afraid with the '1'  why not '2' ... '3'   ?

the good point, you have your solution

Fred

Read only

0 Likes
7,009
  • If you want to know if you are in update task call FM TH_IN_UPDATE_TASK
  • Also could you add the parameter GUI_CHECK_FAILED to the call of the FM.
  • For the effect of WAIT, I suppose FM TH_USER_INFO which communicates with the SAP GUI is somewhat asynchronous and the wait/db_commit generated by the WAIT statement may solve the problem. I wonder if a call of cl_gui_cfw=>flush would give the same result without involving extra delay.

Regards,

Raymond

Read only

Former Member
0 Likes
7,009

Probably this is a commit issue. Have you tried to call your perform on Commit process ?

PERFORM GET_COMP_NAME ON COMMIT.

Cheers!

Abhinab

Read only

0 Likes
7,009

this is definitely not a commit issue:

check this screen-shot:

Read only

0 Likes
7,009

Hi Abhishek,

    Here in your screen shot both table and work area has the same name may system get confused while you update the system so kindly change the work area name may it work.

In update statement pass the condition like set or where.

Here you are update old data it will work if suppose you are updating new data you should use modify key.

Warm Regards,

John.

Read only

Former Member
0 Likes
7,010

Hi Abhishek,

Use statement WAIT UP TO '1' SEC before update syntax. It will update the values in db table.

Regards,

Supriya.

Read only

0 Likes
7,009

i have already used COMMIT WORK AND WAIT.

and please be clear where to use wait statement.

Read only

gurunathkumar_dadamu
Active Contributor
0 Likes
7,009

Hi Abhishek,

if you are using break point means its working..write the WAIT up to 1 sec instead of the break-point.

am also faced the same issue after this statement its working fine.

Regards,

Gurunath

Read only

0 Likes
7,009

IT WORKED!

but why is that so.

what difference does it make it we don't  write this statement?

Read only

0 Likes
7,009

Hi Abhishek,

am not sure why it will happen, please find the following links may help for your query.

http://help.sap.com/saphelp_45b/helpdata/en/34/8e73b76df74873e10000009b38f9b8/content.htm

http://help.sap.com/abapdocu_702/en/abapwait_up_to.htm

Regards,

Gurunath

Read only

Former Member
0 Likes
7,009

Hi,

write WAIT statement in place of breakpoint. it will work.