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

Re:DYNP_VALUES_READ

former_member491305
Active Contributor
0 Likes
317

Hi,

I have used DYNP_VALUES_READ statement to read the screen field value which is of type Quantity.when i am trying to move the read value from it_dynpfields to quantity field ,it is giving me the dump.The reason is i am trying to move the value say 1,25,000.00 to quantity field.I know i can use 'REPLACE ALL OCCURRENCES OF ',' in v_quan_field WITH space.But my question is if the quantity field display format varies, say from 1,25,000.00 to 1.25.000,00,I can't use the replace command.So how to read the quantity field using DYNP_VALUES_READ FM and move it directly to another quantity field?.

CLEAR :x_dynpfield.REFRESH it_dynpfield.

x_dynpfield-fieldname = 'X_ZPINV-ZQTYU'.

APPEND x_dynpfield TO it_dynpfield.

CALL FUNCTION 'DYNP_VALUES_READ'

EXPORTING

dyname = sy-repid

dynumb = sy-dynnr

perform_input_conversion = 'X'

TABLES

dynpfields = it_dynpfield

EXCEPTIONS

invalid_abapworkarea = 1

invalid_dynprofield = 2

invalid_dynproname = 3

invalid_dynpronummer = 4

invalid_request = 5

no_fielddescription = 6

invalid_parameter = 7

undefind_error = 8

double_conversion = 9

stepl_not_found = 10

OTHERS = 11.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

READ TABLE it_dynpfield INTO x_dynpfield INDEX 1.

-


> x_zpinv-zqtyu = x_dynpfield-fieldvalue.

the arrow line giving a dump.The value of x_dynpfield-fieldvalue is 1,25,000.00.

Dump message is "Unable to interpret 1,25,000.00 as a number".

Message was edited by:

Vigneswaran S

1 REPLY 1
Read only

Former Member
0 Likes
270

Hi

try this:

READ TABLE it_dynpfield INTO x_dynpfield INDEX 1. 
DO.
  REPLACE ',' WITH SPACE INTO x_dynpfield-fieldvalue.
  IF SY-SUBRC <> 0. EXIT. ENDIF.
ENDDO.
CONDENSE x_dynpfield-fieldvalue NO-GAPS.

MOVE x_dynpfield-fieldvalue TO x_zpinv-zqtyu.

U can also use TRANSLATE statament:

TRANSLATE x_dynpfield-fieldvalue USING ', '.
CONDENSE x_dynpfield-fieldvalue NO-GAPS.

MOVE x_dynpfield-fieldvalue TO x_zpinv-zqtyu.

Max