Application Development 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: 

field symbol to catch ok code!

Former Member
0 Kudos

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

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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

5 REPLIES 5

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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

0 Kudos

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."

Former Member
0 Kudos

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