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

Query - Can we use 'perform subroutine' in SQ02 code for customer fields?

luobin
Explorer
0 Likes
1,092

Hello.

Now I am develop a report about query.

The question is that I add the Additional fields and add some source codes in code node. Like perform subroutine.

But the program return wrong message when I execute the program:

"The current ABAP program "AQZZYY******====YY***QUERY01==" had to be terminated

  because it has

come across a statement that unfortunately cannot be executed.

The following syntax error occurred in program "/1BCDWB/SAPLIQG000000000082 "

  in include "/1BCDWB/LIQG000000000082U02 " in

line 263:

"Incorrect nesting: Before the statement "FORM", the structure introduc"

"ed by "IF" must be concluded with "ENDIF". ."

" "

" "

There is no if ..endif code in the program.

So whether can  I use the perform or not? How can I solve the issue?

Thanks.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
687

It is possible.

You have to write subrutine in Code Section: 11 Free coding:

FORM SET_VAL USING ev_char20.

   ev_char20 = 'ABCD'.

ENDFORM.

and set value of the additional field in Code Section: 5 Record Precessing:

(no code in field coding)

PERFORM SET_VAL USING ZADD_FLD.

Hello.

Now I am develop a report about query.

The question is that I add the Additional fields and add some source codes in code node. Like perform subroutine.

But the program return wrong message when I execute the program:

"The current ABAP program "AQZZYY******====YY***QUERY01==" had to be terminated

  because it has

come across a statement that unfortunately cannot be executed.

The following syntax error occurred in program "/1BCDWB/SAPLIQG000000000082 "

  in include "/1BCDWB/LIQG000000000082U02 " in

line 263:

"Incorrect nesting: Before the statement "FORM", the structure introduc"

"ed by "IF" must be concluded with "ENDIF". ."

" "

" "

There is no if ..endif code in the program.

So whether can  I use the perform or not? How can I solve the issue?

Thanks.

2 REPLIES 2
Read only

Former Member
0 Likes
688

It is possible.

You have to write subrutine in Code Section: 11 Free coding:

FORM SET_VAL USING ev_char20.

   ev_char20 = 'ABCD'.

ENDFORM.

and set value of the additional field in Code Section: 5 Record Precessing:

(no code in field coding)

PERFORM SET_VAL USING ZADD_FLD.

Read only

0 Likes
687

Hi Wiktor. Thank you for your help.

I tried just now. The perform structure has been achieved.