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

Problems with Hexa !

Former Member
0 Likes
851

HI People

I have this problem in the following lines:

TABLES: HRDBTAB, hrip1001.

DATA: BEGIN OF del_tab OCCURS 0,

vdata like HRDBTAB-vdata.

DATA: END OF del_tab.

DATA: f LIKE hrip1001-PROZT.

field-symbols: <p1001_vdata> type hrip1001.

MOVE 'ST02000003' to del_tab-vdata.

**************************************

  • HERE ->

MOVE '000' to del_tab-VDATA+47(3).

**************************************

APPEND del_tab.

Assign del_tab-vdata to <p1001_vdata> casting.

WRITE:/ <p1001_vdata>-SCLAS.

WRITE:/ <p1001_vdata>-SOBID.

WRITE:/ <p1001_vdata>-PROZT.

WRITE:/ <p1001_vdata>-ADATA.

How can I do to get '0.00' in the field <p1001_vdata>-PROZT, if I move the field del_tab-vdata

to <p1001_vdata>-PROZT.

I have to put blanks chars in del_tab-VDATA+47(3) . If I see it as Hexa I have to see '00' and I see now '30'.

Can somebody help me, please ?

Regards

5 REPLIES 5
Read only

christian_wohlfahrt
Active Contributor
0 Likes
787

Hi Cesar,

char 0 is hex 30 (or dec 30, depending how you read this field).

If you just need to clear proz, you can use

CLEAR del_tab-VDATA+47(3).

Regards,

Christian

Read only

Former Member
0 Likes
787

Hi Cesar,

Use something like this:

CLEAR <p1001_vdata>-PROZT WITH NULL.

WRITE:/ <p1001_vdata>-PROZT.

Regards,

Anand Mandalika.

Read only

Former Member
0 Likes
787

Hi,

What you have put in del_tab-VDATA+47(3) is the string '000'. This is not the same as blanks.

Now the reason why you see 30 in the Hex format is because the character '0' has the ASCII value of 48. And the number 48 in the hexadecimal notation has the value 30.

The character '' (i.e., a blank space) has an ASCII value of 32. Which is 20, if represented in the hexadecimal notation.

Hope the concept is clear.

Regards,

Anand Mandalika.

Read only

Former Member
0 Likes
787

Hi Cesar,

I believe your code should be like this:

TABLES: HRDBTAB, hrip1001.

DATA: BEGIN OF del_tab OCCURS 0,
        vdata like HRDBTAB-vdata.
DATA: END OF del_tab.
DATA: f LIKE hrip1001-PROZT.

FIELD-SYMBOLS: <p1001_vdata> TYPE hrip1001.

* Normal transfer
  del_tab-vdata = 'ST02000003'.

* Set pointer (i think CASTING is not required)
ASSIGN del_tab-vdata TO <p1001_vdata>.

* Set PROZT value
  <p1001_vdata>-prozt = '0.00'.

* Store in internal table
  APPEND del_tab.

* Test output data
  WRITE:/ <p1001_vdata>-SCLAS.
  WRITE:/ <p1001_vdata>-SOBID.
  WRITE:/ <p1001_vdata>-PROZT.
  WRITE:/ <p1001_vdata>-ADATA.

Possibly you can use a clear statement for the PROTZ field like this:

  CLEAR:<p1001_vdata>-prozt.

Hope this helps you a bit.

Regards,

Rob.

Read only

Former Member
0 Likes
787

Hello Cesar,

Obviously, there are people taking their time out to answer your questions. Would you mind rewarding them appropriately for their effort? I see that you have not done that in your earlier posts either. So, if possible assign points and close those threads as well.

Hope you take this in the right spirit.

Regards,

Anand Mandalika.