‎2006 Aug 11 6:21 AM
Hello frnds,
I need to pass HEXVALUE '25' at the end of a text(character type) in SAP and after that it is going into the mainframe system.
Plz do you have any idea how to do this.
Thanks in advance,
Navneet Chaubey
‎2006 Aug 11 6:30 AM
hi,
Try the following eg.
DATA TXT(8) VALUE '19980606'.
DATA mytype(1) VALUE 'X'.
FIELD-SYMBOLS <fs>.
ASSIGN txt TO <fs>.
WRITE / <fs>.
ASSIGN txt TO <fs> TYPE 'D'.
WRITE / <fs>.
ASSIGN TXT TO <FS> TYPE MYTYPE.
WRITE / <fs>.
Example using the CASTING addition:
DATA TXT(8) VALUE '19980606'.
DATA mytype(1) VALUE 'X'.
FIELD-SYMBOLS <fs>.
ASSIGN txt TO <fs>.
WRITE / <fs>.
ASSIGN txt TO <fs> CASTING TYPE d.
WRITE / <fs>.
ASSIGN txt TO <fs> CASTING TYPE (mytype).
WRITE / <fs>.
In both cases, the system displays the following:
19980606
06061998
3139393830363036
In these examples, string TXT is assigned to field symbol <FS> three times: first without casting, then casting with type D and finally with casting with type X. The format of the second output line depends on the data in the user master record. The numbers in the last line are the hexadecimal codes of the characters in txt . They are platform-specific (in this case, ASCII).
Reward if helpful.
Regards