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

Regarding CALL_BACK parameter in subroutine

Former Member
0 Likes
507

Hi,

I have an upgrade error ( version 4.7) saying ' FORM DOES NOT EXIST OR NUMBER OF PARAMETERS ARE DIFFERENT' .

I dont know why i am getting this error can u please check out my code and help me.

Here is my code:

SUB ROUTINE BODY

form api_label_segment using lb like zlblparms call_back.

  • This interface allows the calling app to create labels in rows, for

  • example program ZMBCTMP1 prints 4 stg types on a single label. In

  • the definition of the JOB, a header and trailer may be specified as

  • normal. However, for 'Segmented' labels the MID section has a special

  • structure as follows:

  • posns: 12345678901234567890

  • STG_TYPE_HDR (This is the TOP of the label)

  • STG_TYPE_SEG 0004 (0004 is the max segments/label)

  • STG_TYPE_FTR (Bottom of label eg TRM:\ )

  • This routines accesses MID by index so it can get the formats it

  • needs depending on the number of segments printed. This is very

  • convenient for the calling program since it does not need to know

  • anything about no fo segments or format names, this code calls the

  • header/footer etc. at the appropriate times in the run. All the

  • calling code needs to do is keep calling this form repeatedly (for

  • each 'item' (or segment) it wants to print.

  • Global variable seg_ctr keeps track of how many segments within the

  • label have been printed (and so when the 'footer' is needed etc).

  • See notes above on label_api_hdr for more details of this function.

data: label_name like zbcf-fname.

data: t(80) occurs 0 with header line.

*--Is header required at this point?

if seg_ctr eq 0. " causes the header to print ...

perform get_mid_entry tables t using 1.

debugif sy-subrc ne 0

'Cannot find FIRST Entry in MID table (115)' '' ''.

read table t into label_name index 1.

lb-labelname = label_name.

perform print_a_label using 1 lb.

seg_ctr = 1.

endif.

*--Print the segment...

perform get_mid_entry tables t using 2.

debugif sy-subrc ne 0

'Cannot Find 2nd Entry in MID table (121)' '' ''.

read table t into label_name index 1.

read table t into max_segs index 2.

perform (call_back) in program (sy-cprog)

tables t using seg_ctr if found.

lb-labelname = label_name.

perform print_a_label using 1 lb.

add 1 to seg_ctr.

*--Print the footer if needed now...

if seg_ctr gt max_segs. " causes the trailer to print ...

perform get_mid_entry tables t using 3.

debugif sy-subrc ne 0

'Cannot Find 3rd Entry in MID table (127)' '' ''.

read table t into label_name index 1.

lb-labelname = label_name.

perform print_a_label using 1 lb.

seg_ctr = 0.

endif.

endform. "API_LABEL_SEGMENT

PERFORM STATEMENT

PERFORM API_LABEL_SEGMENT(SAPLZBCD) USING LB.

Regards

Radhika

3 REPLIES 3
Read only

Former Member
0 Likes
475

remove call_back from the form ..

form api_label_segment using lb like zlblparms.

Read only

Former Member
0 Likes
475

use like this...

form api_label_segment using lb like zlblparms .

or check like this..

form api_label_segment using lb like zlblparms zlblparmscall_back .( no gap at the end) .

Read only

Former Member
0 Likes
475

We need to make changes only in the perform statement.