cancel
Showing results for 
Search instead for 
Did you mean: 

Problem printing sapscripts in ME32K transaction.

Former Member
0 Kudos

Hi,

I have problems printing the form in the ME32K transaction, the sapscript is a copy of the Sapscript Medruck. I need to incorporate a perform (using a call to an external program) in the sapscript because I need to obtain an extra information to be inserted in the sapscript. The problem is that the sapscript is not entering to the z program and in consequence the information that i need is not read. The transaction ME32K saves the message to print it through the spool transaction SP02. How can i do to make the perform inside the sapscript works?.

Thanks in advance.

Erika.

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi Everyone,

Thanks Ravindra, Suma y Sheelesh for your advices, but Indeed i used the call perform subroutine using a program Z in the sapscript, but when i run the transaction me32k and send to print the form througn SP02 tx, it never do anything of the instruction inside the perform. I used to debugg a sapscript using a break.pont in the z program, or Go to SE71 and enter form name, then go to utilities and select Activate Debugger, but these aren´t work with this me32k transaction. What else can I do to make the perform inside the sapscript works correctly?.

This is an example of the call of the subroutine:

/: DEFINE &W_ISUBTOT&

/: DEFINE &W_IIVA&

/: DEFINE &W_ITOTAL&

/: PERFORM TOTALES_FINALES IN PROGRAM ZMM_RUTI_PEDIDO

/: USING &EKKO-EBELN&

/: CHANGING &W_ISUBTOT&

/: CHANGING &W_IIVA&

/: CHANGING &W_ITOTAL&

/: ENDPERFORM

/

TC

,, ,, ,, ,, ,,SUBTOTAL,,$,,&W_ISUBTOT& M.N.</>
TC

,, ,, ,, ,, ,, IVA,,$,,&W_IVA& M.N.</>
TC

,, ,, ,, ,, ,, TOTAL,,$,,&KOMK-FKWRT& M.N.</>

Thanks in advance.

Erika.

Former Member
0 Kudos

Hi

You can call any subroutine from sapscript by using the command

Perform

Endperform.

for example

/: PERFORM get_data IN PROGRAM ZTEST

/: USING &var1&

/: CHANGING &var2&

/: ENDPERFORM

and the subroutine get_data in program ZTEST as follows

FORM get_data TABLES l_input_table STRUCTURE itcsy (table to hold the values passed from script)

l_output_table STRUCTURE itcsy. ((table to hold the values passed to script)

write your logic here.

ENDFORM.

Former Member
0 Kudos

Hi,

You can try in 2 ways

1. in the driver program populate the required value in to v_value_program.then call the FM

v_name = '&LABEL_DATA-MARKS7&'.
      v_value =  v_value_program.

    CALL FUNCTION 'TEXT_SYMBOL_SETVALUE'
         EXPORTING
              name            = v_name
              value           =  v_value
*         VALUE_LENGTH    = 0
*         REPLACE_SYMBOLS = ' '
         EXCEPTIONS
              OTHERS          = 1.

in the script use the label '&LABEL_DATA-MARKS7&' where evere above value is required.

2. second way is by using PERFORM in the sapscript as already ravindra said.

Thanks,

Suma.

Former Member
0 Kudos

Hi

To call ABAP subroutines from within a form we use the PERFORM... IN PROGRAM ... statement , the advantage of using it is that the print program is not required to change and we can get the new data from the subroutine which is placed in a Z report . To pass and get the values from th subroutine the parameters are passed which are of type structure ITCSY.

e.g. /:PERFORM get_date IN PROGRAM zreport

/:USING &SALESORDER&

/:CHANGING &S_DATE&

/:ENDPERFORM

The ABAP Code would be

REPORT zreport.

TABLES ztab.

FORM get_date TABLES in_tab STRUCTURE ITCSY out_tab

STRUCTURE ITCSY .

READ TABLE in_tab INDEX 1.

SELECT some_date FROM ztab WHERE salesorder = in_tab-value.

IF sy-subrc EQ 0.

READ TABLE out-tab INDEX 1.

MOVE ztab-somedate TO out_tab-value

MODIFY out_tab INDEX 1.

ENDIF.

ENDFORM.

In the above code USING is used to pass the value to the subroutine while changing is used to recieve the value from the subroutine ,for further paramters we can use either USING or CHANGING .

In the subroutine the type of paramter is always an internal table of type ITCSY irrespective of the value passed.The VALUE field of the internal table is used to fill and recieve the values .

Hope it helps.