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

Problem in generating Spool number

Former Member
0 Likes
960

Hi All,

I am calling one layout(script) from module pool programming.

I am facing a problem, the spool number is not getting generated.

Can anyone let me know what are all the options that are needed to be given in open form, so that spool number will get generated?

Regards,

Raghu

7 REPLIES 7
Read only

brad_bohn
Active Contributor
0 Likes
909

Assuming you're not getting an exception on the OPEN_FORM or CLOSE_FORM, then post your code for the OPTIONS parameter population and the function call so that folks can verify that you tried it yourself first and get a better idea of what you're doing wrong.

Read only

Former Member
0 Likes
909

Below are the options i am giving in the open form:

itcpo-tddest = 'LOCL'.

itcpo-tdnewid = 'X'.

itcpo-TDNOPREV = 'X'.

itcpo-tddelete = space.

itcpo-tdprogram = sy-repid.

Read only

0 Likes
909

Hi,

Are you able to see the preview?

Not sure if below code works....

Just before OPEN_FORM use statement

LEAVE TO LIST-PROCESSING.

And just after close form use

LEAVE LIST-PROCESSING.

Usually we use this for list processing. Not sure if we need to use the same for form output also. Just give a try.

Thanks,

Vinod.

Read only

Former Member
0 Likes
909

No I dont want to go for list processing.

I just want to spool number to be generated.

So that we can take print out from SP01.

Read only

Former Member
0 Likes
909

Parameters to be passed in open form.

CALL FUNCTION 'OPEN_FORM'
       EXPORTING
            FORM           = TNAPR-FONAM
            LANGUAGE       = NAST-SPRAS
            OPTIONS        = ITCPO
            ARCHIVE_INDEX  = TOA_DARA
            ARCHIVE_PARAMS = ARC_PARAMS
            DEVICE         = XDEVICE
            DIALOG         = ' '
       EXCEPTIONS
            OTHERS         = 1.

READ TABLE it_spool INTO wa_spool INDEX 1.
  v_spoolno = wa_spool-rqident.
*Get Spool request attributes
  SELECT SINGLE *
    FROM tsp01
    INTO tsp01
    WHERE rqident EQ v_spoolno.

  IF sy-subrc <> 0.
    MESSAGE i000 DISPLAY LIKE 'E'
                      WITH text-003 v_spoolno text-034.
    LEAVE LIST-PROCESSING.
  ENDIF.

  v_client = tsp01-rqclient.
  v_name   = tsp01-rqo1name.

CALL FUNCTION 'RSTS_GET_ATTRIBUTES'
    EXPORTING
      authority     = 'SP01'
      client        = v_client
      name          = v_name
      part          = 1
    IMPORTING
      objtype       = v_objtype
    EXCEPTIONS
      fb_error      = 1
      fb_rsts_other = 2
      no_object     = 3
      no_permission = 4
      OTHERS        = 5.
  IF sy-subrc <> 0.
    MESSAGE i000(zz) DISPLAY LIKE 'E'
                       WITH text-003 v_spoolno text-034.
    LEAVE LIST-PROCESSING.
  ENDIF.

Read only

Former Member
0 Likes
909

Guys spool number is generating when i keep the break-point in the program and once reach the break-point, by just executing it.

But when i remove the break point and run it directly without any break point then no spool number is getting generated.

Please let me know how to fix this.

Read only

Former Member
0 Likes
909

Please give the code?