cancel
Showing results for 
Search instead for 
Did you mean: 

variable in script not printing

former_member1292715
Participant
0 Kudos

Hi guys,

I have form and driver program. while debugging in the driver program I can see the values of the fields, but in the script debugger I can not. Please have a look at my coding. Please correct me if I was wrong.

SELECT SINGLE ktext
    FROM crtx
    INTO gv_ktext
    WHERE objid EQ iviqmel-arbpl. " value is there for GV_KTEXT which is global

  CALL FUNCTION 'OPEN_FORM'
    EXPORTING
      device                      = 'PRINTER'
      form                        = 'ZPMF_PMOR'
      dialog                      = space
      language                    = 'E'
      OPTIONS                     = gs_itcpo. " ....

  CALL FUNCTION 'WRITE_FORM'
    EXPORTING
      element = 'HEADER'
      window  = 'MAIN'.   " But not appearing in output 

  " Closing forms and other coding here

  /E HEADER
  P1 Category: &GV_KTEXT& " In script, I am printing like this

Accepted Solutions (1)

Accepted Solutions (1)

former_member1292715
Participant
0 Kudos

Guyz.. Any body can??

I have only one text element HEADER in main window. In that I can print system variables like &SYST-DATUM& but not program variables. Not only printing I can't even access them like IF &VIQMEL-BUKRS& = '1000'. Any particular reason..

Please throw your ideas which not necessary to be an answer.

Regards,

Yasin.

Former Member
0 Kudos

Hi Yasin ,

1. Check your variable. It should be declared as global variable.

2. If you are using two clients

I.e One client for development

Another one is for testing then

Just check script is getting transported properly to testing client using SCC1.

former_member1292715
Participant
0 Kudos

Hi Anil,

Appreciate your reply.

Here, I declared the variable globally in the print program and I am using only one client for development and testing.

Here is my declaration part.

DATA: gs_itcpo TYPE itcpo,
      gv_qmartx TYPE tq80_t-qmartx,
      gv_ktext  TYPE crtx-ktext.

antony_paul2
Active Participant
0 Kudos

Hi,

1. Make sure you have declared GV_KTEXT in an global area. Not inside any FORM ... ENDFORM.

2. In the structure you have declared , gs_itcpo, there is a field TDPROGRAM, pass sy-repid to it

 gs_itcpo-TDPROGRAM = sy-repid. 

Then try again

Regards,

Antony

former_member1292715
Participant
0 Kudos

Excellent Job.... Antony Paul.. Thanks a lottt......!!!

Answers (0)