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

OAHEX

Former Member
0 Likes
1,836

Hi,

When I execute program OAHEX in 5.0 I don't get any output while the same program in 4.5B works correctly. Has anybody come across this problem?

Thanks,

Anuranjan

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,819

Is your Unicode checks active or not in the attributes for that program?

22 REPLIES 22
Read only

Former Member
0 Likes
1,819

HI Anuranjan Sharma,

I'm on 5.0 and its working for me.Can you see that program in se38??

Regards,

Ravi

Read only

0 Likes
1,819

Hi Ravi,

This is the coding I have:

REPORT OAHEX .

PARAMETER: INPUT(2) DEFAULT 'A' LOWER CASE.

DATA: MAX_X TYPE X VALUE '80',

OUTPUT(2),

BEGIN OF X,

X TYPE X,

END OF X,

P TYPE P,

HEX TYPE X.

*MOVE INPUT TO X. MOVE INPUT TO HEX.

MOVE X-X TO OUTPUT.

MOVE X-X TO P.

WRITE: 'Eingabewert'(001), AT 20 'Hexadezimal'(002),

AT 40 'Dezimal'(003), AT 60 'Zuweisung'(004).

ULINE.

WRITE: INPUT, AT 20 OUTPUT, AT 40 P LEFT-JUSTIFIED, AT 60 HEX.

What is it there in urs?

Thanks a lot for quick reply

Read only

0 Likes
1,819

Hi,

It is exactly the same here too.

What did you mean when you say it is not working correctly?

Regards,

Ravi

Read only

0 Likes
1,819

When I enter A as input out I get is:

Output of hexadecimal values

Input Value Hexadecimal Decimal Assgmt

A 00 0 00

While in 4.5 it works like this

Input value Hexadecimal Decimal Assgmt

A 41 65 A0

Only difference in coding is line

move input to x. move input to hex.

is not commented in 4.5

Read only

Former Member
0 Likes
1,820

Is your Unicode checks active or not in the attributes for that program?

Read only

0 Likes
1,819

Yes it's active.

Read only

0 Likes
1,819

Hi it is working for me...

but giving no values..

vijay

Message was edited by: Vijay Babu Dudla

Read only

0 Likes
1,819

Vijay, R u on 5.0 and do u have the output same as I have shown above for 4.5.

Read only

0 Likes
1,819

it is not giving output as in 4.7

Read only

0 Likes
1,819

Hi Sharma,

When I do a EPC for that program, it says,

The namespace of the program OAHEX has the setting "C" and cannot be tested

A possible cause for this is that an SAP program is being checked in a customer

system

Note, the following rule applies after a change in the source code:

For testing the namespace setting is ignored for one week

(The message cannot be hidden using pseudo-comment "#EC .., bzw. durch SET

EXTENDED CHECK OFF/ON)

Probably it is a reason.

Regards,

ravi

Read only

0 Likes
1,819

Hi Sharma,

The line in bold is the reason.

REPORT OAHEX .

PARAMETER: INPUT(2) DEFAULT 'A' LOWER CASE.

DATA: MAX_X TYPE X VALUE '80',

OUTPUT(2),

BEGIN OF X,

X TYPE X,

END OF X,

P TYPE P,

HEX TYPE X.

<b>*MOVE INPUT TO X. MOVE INPUT TO HEX.</b>

MOVE X-X TO OUTPUT.

MOVE X-X TO P.

WRITE: 'Eingabewert'(001), AT 20 'Hexadezimal'(002),

AT 40 'Dezimal'(003), AT 60 'Zuweisung'(004).

ULINE.

WRITE: INPUT, AT 20 OUTPUT, AT 40 P LEFT-JUSTIFIED, AT 60 HEX.

Probably it is commented for some reason by SAP.

See if it uncommented in 4.5.

Read only

0 Likes
1,819

Hi Ravi,

U mean to say SAP is still working on this and we should wait till they fix it.

Thanks,

Anuranjan

Read only

0 Likes
1,819

Hi Sharma,

I ran the program in 46C and got the result you got in 45 and I ran it in 47 and got the result you got for 5. The difference between the two is as Ravi pointed out. The line "MOVE INPUT TO X. MOVE INPUT TO HEX." is commented out in the higher version and it is not in the lower version.

Srinivas

Read only

0 Likes
1,819

Exactly. May be it will be fixed in the next Patch level.

Read only

0 Likes
1,819

Hi Srinivas,

So I should open a message with SAP right?

Thanks,

Anuranjan

Read only

0 Likes
1,819

What are you using this for? It is a simple program, which probably you can also copy and uncomment those lines. I don't know if SAP is going to work on this or fix. May be it is intended to work this way.

Srinivas

Read only

0 Likes
1,819

i tried uncommenting, it is throwing some errors..

and if you really want that then you can copy it from 4.7

and use it..

vijay

Read only

0 Likes
1,819

I did a where-used on the program and it is not used anywhere.

Read only

0 Likes
1,819

Hi Srinivas,

I tried that first but the commneted line causes syntax error.

thanks

Anuranjan

Read only

0 Likes
1,819

Ok, SAP commented the code because it is not unicode compliant and here is the error message.

<b>"X" and "INPUT" are not mutually convertible in Unicode systems, since you are trying to convert a structure to a field or vice versa. You can only convert these objects in the following cases:

If the structure is completely character-type, the single field can have any type.

Otherwise, the field must have the data type C and the structure must begin with a character-type field that is at least as long as the single field.</b>

Read only

0 Likes
1,819

Change the statement

<i>MOVE input TO x. MOVE input TO hex.</i>

to

<b>MOVE input TO x-x. MOVE input TO hex.</b>

But this is giving a different result.

Srinivas

Read only

0 Likes
1,819

Actually since the unicode checks came into picture, hex and char are no longer compatible. If I have a statement like

"concatenate hex input into junk separated by '?'." in a unicode system, it gives me an error that they are not compatible.

Whereas if I use the same command in 46c, it is not giving me the error.

Srinivas