01-21-2009 12:00 PM
Hi,
can any body explain the code below. I didn't understand how the ok code is being captured!
DATA: gv_okcode_field TYPE char20 VALUE '(SAPLIQS0)OK-CODE'. "OK code
FIELD-SYMBOLS <okcode_value> TYPE ANY.
ASSIGN gv_okcode_field TO <okcode_value>.
IF sy-subrc = 0.
IF <okcode_value> = 'URL'.
CALL SCREEN '0102' STARTING AT 10 1
ENDING AT 128 25.
ENDIF. "if function code is URL
ENDIF. " if field symbol is assigned
regards,
Ravi Valluri
01-21-2009 12:09 PM
Hi Guys,
pls understand the code, the field symbol is pointing to (SAPLIQS0)OK-CODE.
and it's value is URL.
there is nothing wrong with the code. I want to know the concept here. how the ok code is captured
regards,
Ravi Valluri
01-21-2009 12:04 PM
hi,
Sy-subrc is not required after the assign statement. with assign statement the value from gv_okcode_field is assigned to Field symbol.
DATA: gv_okcode_field TYPE char20 VALUE '(SAPLIQS0)OK-CODE'. "OK code
FIELD-SYMBOLS <okcode_value> TYPE ANY.
ASSIGN gv_okcode_field TO <okcode_value>.
IF <okcode_value> = 'URL'.
CALL SCREEN '0102' STARTING AT 10 1
ENDING AT 128 25.
ENDIF. "if function code is URL
01-21-2009 12:05 PM
your ok code is '(SAPLIQS0)OK-CODE'.
then your checking <okcode_value> = 'URL'. this not correct.
DATA: gv_okcode_field TYPE char20 VALUE '(SAPLIQS0)OK-CODE'. "OK code
FIELD-SYMBOLS <okcode_value> TYPE ANY.
ASSIGN gv_okcode_field TO <okcode_value>.
IF sy-subrc = 0.
IF <okcode_value> = 'URL'. you can pass here (SAPLIQS0)OK-CODE'
CALL SCREEN '0102' STARTING AT 10 1
ENDING AT 128 25.
ENDIF. "if function code is URL
01-21-2009 12:09 PM
Hi Guys,
pls understand the code, the field symbol is pointing to (SAPLIQS0)OK-CODE.
and it's value is URL.
there is nothing wrong with the code. I want to know the concept here. how the ok code is captured
regards,
Ravi Valluri
01-21-2009 12:35 PM
I found something interesting in the documentation of ASSIGN statement. Must be helpful to you.
"The label in name can also have the form (PROG)DOBJ for internal use only, where PROG is the name of an ABAP program and DOBJ is the name of a global data object of this program. If the program PROG is loaded during execution of the statement ASSIGN in the same internalmode as the current program, the data object (PROG)DOBJ is searched for in this program, and the field symbol points to this data object after the object has been successfully assigned."
01-21-2009 12:29 PM
Hello Guys,
Code which catches the memory value of ((SAPLIQS0)OK-CODE) to use it in current program.
Show's the power of using field symbol.
Best Regards,
Vibin Srinivas