Application Development 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: 

Regarding Dynp_values_read

Former Member
0 Kudos

hi all,

i have to read ascreen field of type NUM(8) and when i pass it to FM Dynp_values_read

the field FIELDVALUE in DYNPREAD structure is of character type.now after coming out of this FM my fieldvalue is of type character and not of type.NUM8.

DATA: dyname LIKE d020s-prog VALUE 'Z_PREMRP',

dynumb LIKE d020s-dnum VALUE '1000'.

DATA: BEGIN OF dynpfields OCCURS 3.

INCLUDE STRUCTURE dynpread.

DATA: END OF dynpfields.

MOVE 'PROJECT-LOW' TO dynpfields-fieldname.

APPEND dynpfields.

CALL FUNCTION 'DYNP_VALUES_READ'

EXPORTING

dyname = dyname

dynumb = dynumb

TABLES

dynpfields = dynpfields.

READ TABLE dynpfields WITH KEY fieldname = 'PROJECT-LOW'.

IF sy-subrc = 0.

  • dynpfields-fieldvalue = pspnr1(type num 8).

pspnr1 = dynpfields-fieldvalue .

ENDIF.

i want the fieldvalue to be in num8 any help wud be appreciated

8 REPLIES 8

Former Member
0 Kudos

After U get the value from the FM 'DYNP_VALUES_READ'

use FM CONVERSION_EXIT_ALPHA_INPUT to get the 0's padded in front and pass this to

the field of type NUM

0 Kudos

thanks for your reply but clearly my issue is

im passing fieldvalue : NE-005 to FM DYNP_VALUES_READ

and it is getting converted to : 00000005

now how do i convert it back to the same value.

Thanks in advance,

Naren

Edited by: naren on Feb 25, 2009 12:22 PM

0 Kudos

a variable of type N cannot hold a char ..

In your case (NE-005) cannot be assigned to a numeric variable ..

0 Kudos

any help wud be greatfull. Srinivaas.

im waiting for replies friends.

thanks.

0 Kudos

Hi,

To my understanding, If Num holds 00000005 then you need to get 5 in a CHAR Variable. If this is the case then make sure that the CHAR Var is of length similar to Num. Move Num to VAR then use SHIFT statement to remove all the 0's.

If this is not the case then breif your requirement.

Thanks,

Prashanth

Former Member
0 Kudos

Hi,

Check by moving the Field from Function Module to a Variable of type NUM(8).

Hope this would work.

Thanks,

Prashanth

Former Member
0 Kudos

Hi,

can you please check this link,it may help you

Thanks and regards

Durga.K

awin_prabhu
Active Contributor
0 Kudos

Hi friend,

See FM 'MOVE_CHAR_TO_NUM' .

Use FM 'MOVE_CHAR_TO_NUM' after 'DYNP_VALUES_READ'.

Thanks..

Edited by: Sap Fan on Feb 25, 2009 11:39 AM

Edited by: Sap Fan on Feb 25, 2009 11:40 AM