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

Error while calling PERFORM in SAPSCRIPT

Former Member
0 Likes
990

Hi all,

I am encoutering a error while calling a perform in sapscript.

Does anyone know what is the main cause?

The shortdump description is:

Short text

Missing parameter with PERFORM.

I do not know what is missing here.


/: PERFORM GET_SPRAS IN PROGRAM ZPFI_F150_DUNN
/: USING &MHNK-KUNNR&
/: CHANGING &GV_SPRAS&
/: CHANGING &GV_LAND1&
/: ENDPERFORM


*&---------------------------------------------------------------------*
*&      Form  GET_SPRAS
*&---------------------------------------------------------------------*

FORM GET_SPRAS TABLES intable   STRUCTURE itcsy
                      outtable  STRUCTURE itcsy
                      outtable2 STRUCTURE itcsy.

  DATA: lv_kunnr LIKE kna1-kunnr.
  CLEAR: GV_SPRAS.

  lv_kunnr = intable-value.

  CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
    EXPORTING
      input  = lv_kunnr
    IMPORTING
      output = lv_kunnr.

  SELECT SINGLE LAND1 SPRAS INTO (gv_land1, gv_spras) FROM KNA1
    WHERE KUNNR = lv_kunnr.

  IF sy-subrc = 0.
    READ TABLE outtable INDEX 1.
    outtable-value = gv_spras.
    MODIFY outtable INDEX 1.

    READ TABLE outtable2 INDEX 1.
    outtable2-value = gv_land1.
    MODIFY outtable INDEX 1.

  ENDIF.

  IF gv_land1 EQ 'DE'.
    CLEAR: GV_LAND1,
           GV_SPRAS.
  ENDIF.

ENDFORM.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
895

Hi,

Though there are a lot of importing parameters, you should give only one structure for outtable, and read as index 1 and index 2.

FORM GET_SPRAS TABLES intable STRUCTURE itcsy

outtable STRUCTURE itcsy.

DATA: lv_kunnr LIKE kna1-kunnr.

CLEAR: GV_SPRAS.

lv_kunnr = intable-value.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

input = lv_kunnr

IMPORTING

output = lv_kunnr.

SELECT SINGLE LAND1 SPRAS INTO (gv_land1, gv_spras) FROM KNA1

WHERE KUNNR = lv_kunnr.

IF sy-subrc = 0.

READ TABLE outtable INDEX 1.

outtable-value = gv_spras.

MODIFY outtable INDEX 1.

READ TABLE outtable INDEX 2.

outtable-value = gv_land1.

MODIFY outtable INDEX 2.

ENDIF.

IF gv_land1 EQ 'DE'.

CLEAR: GV_LAND1,

GV_SPRAS.

ENDIF.

ENDFORM.

Edited by: Srinivas Kalluri on Mar 30, 2009 5:00 AM

Edited by: Srinivas Kalluri on Mar 30, 2009 5:10 AM

7 REPLIES 7
Read only

Former Member
Read only

0 Likes
895

Hi Satya,

Thanks for your reply. My question here is how can I CHANGING for two values

/: PERFORM GET_SPRAS IN PROGRAM ZPFI_F150_DUNN

/: USING &MHNK-KUNNR&

/: CHANGING &GV_SPRAS&

/: CHANGING &GV_LAND1&

/: ENDPERFORM

What the subroutine for calling from SAPSCRIPT will look like?

Thanks.

Read only

0 Likes
895
 in SE71: 
PERFORM PERFORM12 IN PROGRAM ZSCRIPT12
USING &VAR1&
 CHANGING &VAR2&
CHANGING &VAR3&
 ENDPERFORM

 In SE38: 
PROGRAM  ZSCRIPT12.

FORM perform12 TABLES in_tab STRUCTURE itcsy
out_tab STRUCTURE itcsy.

read table out_tab index 1. " For Var2
read table out_tab index 2. " For Var3
endform.

Irrespective of the number of parameters you pass, you can use only one in_tab & one out_tab parameters in the FORM statement.

You can access the data using INDEX statement.

Read only

Former Member
0 Likes
896

Hi,

Though there are a lot of importing parameters, you should give only one structure for outtable, and read as index 1 and index 2.

FORM GET_SPRAS TABLES intable STRUCTURE itcsy

outtable STRUCTURE itcsy.

DATA: lv_kunnr LIKE kna1-kunnr.

CLEAR: GV_SPRAS.

lv_kunnr = intable-value.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

input = lv_kunnr

IMPORTING

output = lv_kunnr.

SELECT SINGLE LAND1 SPRAS INTO (gv_land1, gv_spras) FROM KNA1

WHERE KUNNR = lv_kunnr.

IF sy-subrc = 0.

READ TABLE outtable INDEX 1.

outtable-value = gv_spras.

MODIFY outtable INDEX 1.

READ TABLE outtable INDEX 2.

outtable-value = gv_land1.

MODIFY outtable INDEX 2.

ENDIF.

IF gv_land1 EQ 'DE'.

CLEAR: GV_LAND1,

GV_SPRAS.

ENDIF.

ENDFORM.

Edited by: Srinivas Kalluri on Mar 30, 2009 5:00 AM

Edited by: Srinivas Kalluri on Mar 30, 2009 5:10 AM

Read only

Former Member
0 Likes
895

Hi,

Kindly go through this link below:

Hope it helps

Regards

Mansi

Read only

Former Member
0 Likes
895

HI myahsam,

[Perform in Sapscript|http://www.sapfans.com/sapfans/forum/r2all/messages/181.html]

Regards,

Sravanthi

Read only

I355602
Product and Topic Expert
Product and Topic Expert