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

Bit Programming in ABAP

Former Member
0 Likes
999

I have a specific requirement to convert one standard to another.

The length of given standard is 13 where first two and last two alphabets are Characters...all the others are numeric values. for e.g. FF123456789JJ.

I have to convert it into EPC (Electronic Product code) standard so that EM (Event Management) Module can understand it,

Is there any function module available for conversion purpose??

Also If I have to work with individual bits for conversion purpose.. Any Idea , how it can be achieved?

1 ACCEPTED SOLUTION
Read only

pavan_prabhu
Active Participant
0 Likes
919

Is FF123456789JJ the unique serial number?

If yes, you can try this if it works.

UPC + Unique Serial number = EPC

The RFID/EPC tag contains the UPC plus a serial number which differentiates one like item from another.

If FF123456789JJ is a unique serial number you have to get details to generate bar code and concatenate the UPC with this unique serial number which as a whole acts as a EPC for differentiating an item from one another.

5 REPLIES 5
Read only

pavan_prabhu
Active Participant
0 Likes
920

Is FF123456789JJ the unique serial number?

If yes, you can try this if it works.

UPC + Unique Serial number = EPC

The RFID/EPC tag contains the UPC plus a serial number which differentiates one like item from another.

If FF123456789JJ is a unique serial number you have to get details to generate bar code and concatenate the UPC with this unique serial number which as a whole acts as a EPC for differentiating an item from one another.

Read only

Former Member
0 Likes
919

not sure about any FM though that would be preferable idea. if you want to process individual bit you can use offsets.

Read only

0 Likes
919

It seems, offsets can only be used for hexadecimal objects. Can It be used for decimal objects??

Example

The hexadecimal value "1B" is assigned to the data object hex and its bits are read from front to back. The output is "00011011", which corresponds to the binary display of decimal 27 or hexadecimal "1B".

DATA: len TYPE i,

      res TYPE i,

      hex TYPE xstring. 

hex = '1B'.

len =  XSTRLEN( hex ) * 8. 

WHILE sy-index <= len.

  GET BIT sy-index OF hex INTO res.

  WRITE (1) res NO-GAP.

ENDWHILE.

In the above example, I want to pass decimal value through hex variable(type p) and get desired result. Well, I don't think , It is possible through offsets. Is it?

Read only

Former Member
0 Likes
919

hi ratnakar,

    EPC code is FF123456789JJ what is EM code ? any example is there?

Read only

0 Likes
919

FF123456789JJ is not EPC Code.  To convert the given unique code (for e.g. FF123456789JJ) to EPC, basically i have to convert it to binary format. I can covert it to binary format through this way ...GIVEN UNIQUE CODE--->ASCII CODE(in decimal)--->BINARY FORMAT.So Is there any specific fm to convert decimal to binary in abap?