cancel
Showing results for 
Search instead for 
Did you mean: 

Sapscript Error when using a perform call - CONVT_NO_NUMBER

0 Kudos

I am trying to pass back and forth numeric values in my perform call, when I use the code below and pass a value < 1000 the form prints fine, when a pass a value >= 1000 I get an "inbox" error of CONVT_NO_NUMBER.

I am unable to debug the form, so I am not sure if the error is occurring in the form or the abap program.

I am trying to pass the program ZWESCHEINVERS_FORM_ROUTINES the total quantity received (mseg-menge) and return the material master rounding value in MRP 1 view and the program calculates the number of pieces (v_pce_count) received by dividing total quantity/rounding value.

Any help is appreciated.

Sapscript Perform:

/: PERFORM GET_MATERIAL_PLANT IN PROGRAM ZWESCHEINVERS_FORM_ROUTINES

/: USING &MSEG-MATNR&

/: USING &T001W-WERKS&

/: USING &MSEG-MENGE&

/: CHANGING &V_ROUND_VAL&

/: CHANGING &V_PCE_COUNT&

/: ENDPERFORM

/*

K1 Vendor Batch :,,&V_VENDBATCH&,,

K1 Pull Sample :,,&v_atwrt& ,,Batch Created:,,&V_BATCHCRT&

K1 Piece Amount :,,&V_ROUND_VAL&,,

K1 Piece Count :,,&V_PCE_COUNT&,,

/* END OF CHANGE BY BEV BARBUSH 09/25/08,12/21/08

M5 Quantity :,,&MSEG-MENGE&,,&MSEG-MEINS&

FORM get_material_plant TABLES in_tab STRUCTURE itcsy

out_tab STRUCTURE itcsy.

DATA : lv_matnr TYPE matnr,

lv_werks TYPE werks_d,

lv_pce_count TYPE p decimals 4,

lv_tot_qty TYPE menge_d,

lv_round_val TYPE bstrf. "marc rounding value

READ TABLE in_tab INDEX 1.

lv_matnr = in_tab-value.

READ TABLE in_tab INDEX 2.

lv_werks = in_tab-value.

READ TABLE in_tab INDEX 3.

lv_tot_qty = in_tab-value.

CALL FUNCTION 'CONVERSION_EXIT_MATN1_INPUT'

EXPORTING

input = lv_matnr

IMPORTING

output = lv_matnr

EXCEPTIONS

length_error = 1

OTHERS = 2.

CHECK sy-subrc = 0.

SELECT SINGLE bstrf

FROM marc

INTO lv_round_val

WHERE matnr = lv_matnr AND werks = lv_werks.

CHECK sy-subrc = 0.

READ TABLE out_tab INDEX 1.

IF SY-SUBRC <> 0.

out_tab-value = 'Material Plant not found'.

ELSE.

v_PieceAmt_string = lv_round_val.

out_tab-value = v_PieceAmt_string.

ENDIF.

MODIFY out_tab INDEX 1.

READ TABLE out_tab INDEX 2.

IF ( lv_round_val <> 0 ).

lv_pce_count = lv_tot_qty / lv_round_val.

v_PieceCnt_string = lv_pce_count.

out_tab-value = v_PieceCnt_string.

ELSE.

out_tab-value = 'No Rounding Value'.

ENDIF.

MODIFY out_tab INDEX 2.

ENDFORM. "GET_Material_plant

Accepted Solutions (1)

Accepted Solutions (1)

naimesh_patel
Active Contributor
0 Kudos

Actually when you pass MSEG-MENGE to your subroutine GET_MATERIAL_PLANT it passing the value with the Format. Like 12000 would go like 12,000 (with the Comma). So, you need to remove the Comma before moving that to LV_TOT_QTY variable.


DATA: L_QTY TYPE CHAR20.

READ TABLE in_tab INDEX 3.
L_QTY = in_tab-value.
replace all occurrences of ',' in L_QTY with ' '.
condense L_QTY.
lv_tot_qty = L_QTY.

Note: Decimal notation comma(,) or dot(.) are depends on your User settings.

Regards,

Naimesh Patel

0 Kudos

thank you for your help, that solved the problem. and thanks for the script on replacing and condensing, I am new and it would have taken awhile to write that code and it wouldn't have been so clean and concise.

Answers (0)