‎2005 Aug 30 2:41 PM
hey guys,
MODULE PAI_CHECK.
MODIFY MYTAB FROM LTAB INDEX ZTABDISP-CURRENTLINE transporting KUNRR STATUS.
SET CURSOR FIELD 'LTAB-KUNNR'
MESSAGE E005.
....
END MODULE.
does not allow me to put cursor at KUNNR field, instead
it stands in first column itself..
what could be the reason here..
ambichan
‎2005 Aug 30 3:06 PM
Is KUNNR in field list
eg
loop
field kunnr
module pai_check
endloop...
regds
gv
‎2005 Aug 30 3:18 PM
hey venkat,
yes
its like this
LOOP AT MYTAB.
CHAIN
FIELD KBN:
INPT:
KUNNR:
MATNR:
ZLOTB:
MODIFY ZTABDISP_MODULE ON CHAIN REQUEST.
ENDCHAIN.
MODULE ZTABDISP_MODULE.
MODIFY....
SET CURSOR FIELD ...
MESSAGE E003.
ENDMODULE.
like this..
ambichan
‎2005 Aug 30 4:40 PM
I think it doesn't work, if you put a control with error or warming message into CHAIN/ENDCHAIN statament, I believe the system sets cursor in the first field.
‎2005 Aug 31 1:39 AM
hey guys,
could you pls give me correct alternative code or idea to replace my code..equavalantly?
thanks in advance.
ambichan
‎2005 Aug 31 1:48 AM
Hi
try this.
SET CURSOR FIELD <b>LTAB-KUNNR</b>
LINE <tablecontrol name>-CURRENT_LINE.
Message ....
Delete the single code between the field LTAB-KUNNR and try.
regds
gv
Message was edited by: Venkat
‎2005 Aug 30 3:11 PM
Try setting the cursor field in the PBO.
If this is to point the user at the error which is occuring, then it should happend automatically if you are coding it correctly.
This statement should actually be in its own module.
MODIFY MYTAB FROM LTAB INDEX ZTABDISP-CURRENTLINE transporting KUNRR STATUS.
The checks should be in their own modules.
MODULE CHECK_KUNNR.
IF ltab-kunnr is initial.
message E005.
endif.
ENDMODULE.
In your flow logic, in the PAI, you should be coding your checks like this.
LOOP AT LTAB.
MODULE YOUR_MODIFY_STATEMENT.
FIELD LTAB-KUNNR MODULE CHECK_KUNNR.
ENDLOOP.
Regards,
Rich Heilman
‎2005 Aug 30 3:13 PM
I think you should write in which line you want to set cursor:
SET CURSOR FIELD 'LTAB-KUNNR' LINE SY-STEPL.
‎2005 Aug 31 3:45 AM
for that field check in attributes in screen painter, whether set and get parameters are unchecked.
not sure just a try, hope it help
regards
‎2005 Aug 31 5:27 AM
hey surpreet singh,
thanks for your reply.
i am just working on this..if solved i will surely close this thread.
Sorry for late response.
ambichan
‎2005 Aug 31 5:29 AM
Hello Ambi,
it's ok , but be sure to get back how you solved this problem.
Cause what i told you, i read that yesterday in one of thread here.
regards
‎2005 Aug 31 5:37 AM
Sure supreet singh.
I am always in touch..
btw, i just tried the above option too..i could not
set the cursor field to particular error place.
it always stands in first place..
is it drawback of CHAIN and ENDCHAIN?
I checked attributes also..set and get parameters are
not checked.
just looking what could be the alternate way..
ambichan.
‎2005 Aug 31 5:38 AM
ambi
did u try this
SET CURSOR FIELD LTAB-KUNNR
LINE <tablecontrol name>-CURRENT_LINE.
Message ....
Delete the single code between the field LTAB-KUNNR and try.
regds
gv
‎2005 Aug 31 12:37 PM
hay venkat,
yes again i tried with your command.
SET CURSOR FIELD LTAB-KUNNR LINE ZTABDIS-CURRENT_line.
but still not working..
does the cursor field wont work in chain..endchain?
ambichan
‎2005 Aug 31 1:06 PM
No! I think it doesn't work in PAI.
I created a dynpro with 3 fields: A, B, C. In PAI I put only one module: SET_CURSOR
MODULE SET_CURSOR INPUT.
SET CURSOR FIELD 'B'.
ENDMODULE.
In PBO i put only one module: GET_CURSOR
MODULE GET_CURSOR OUTPUT.
DATA FIELD.
GET CURSOR FIELD FIELD.
ENDMODULE. " GET_CURSOR OUTPUT
The get cursor command always return sy-subrc = 4
‎2005 Aug 31 1:13 PM
Hey max,
Thanks for your reply.
Hey Rich, I did not get your explanation clearly w.r.t
SET CURSOR FIELD.
could you pls state your point little bit clear and more.
will be great help.
ambichan.
‎2005 Aug 31 1:29 PM
I think you can solve your problem using a message type I, not E.
PROCESS PBO
LOOP...
MODULE SET_CURSOR.
ENDLOOP.
PROCESS PAI
LOOP..
CHAIN.
FIELD: FIELD1,
FIELD2,
FIELD3 MODULE CHECK_FIELD.
ENDCHAIN.
ENDLOOP.
MODULE CHECK_FIELD.
clear step_error.
IF FIELD = ERROR.
MESSAGE I208(00) WITH 'Error'.
CLEAR OK_CODE.
step_error = sy-stepl.
Leave PAI process:
leave screen.
ENDIF.
ENDMODULE.
MODULE SET_CURSOR.
CHECK STEP_ERROR > 0.
SET CURSOR FIELD 'KUNNR' LINE STEP_ERROR.
ENDMODULE.
‎2005 Sep 01 5:29 AM
LOOP..
CHAIN.
FIELD: FIELD1,
FIELD2,
FIELD3 MODULE CHECK_FIELD on chain-request.
ENDCHAIN.
ENDLOOP.
if we use field1,2,3 and on chain-request then the cursor automatically goes to field1 eventhough if we set the cursor externally.
so u have to remove <b>ON CHAIN-REQUEST</b> or have to think different logic.
regards
gv