cancel
Showing results for 
Search instead for 
Did you mean: 

BAdi: Construct ID from Components in Bar Code

james_tucker2
Explorer
0 Kudos

Has anyone used this BAdI in Aii 7.1? Trying to find where this BAdI is called. Looking for a method to convert between various barcode data, e.g. (01) (21) (10) (17) (30), and either parse out the AI data not contained in the GS1_SER ID or convert to SGTIN-96 depending on how the object id is stored in Aii. This BAdI appears to be for this purpose, but when we activate it and create our enhancement spot I am not finding where the BAdI is called from /AIN/CL_CTX_INIT or other class.

Accepted Solutions (0)

Answers (5)

Answers (5)

james_tucker2
Explorer
0 Kudos

To resolve this issue, apply Note 1650334.

james_tucker2
Explorer
0 Kudos

The BAdI only works with /AIN/MOBILE1 and not with /AIN/MOBILE2. We've placed an OSS note to confirm this behaviour with SAP.

james_tucker2
Explorer
0 Kudos

In order for the BAdI to work, the barcode ID needs to be in the raw format, e.g. include the barcode header ]C1 or ]d2 followed by the barcode data. For example, ]C1011003700000100021100003060003 or ]d2011003700000100021100003060003.

By default, the /AIN/MOBILE2 UI will not recognize the barcode ID Type when passing the barcode in the above format. So, I created a Z barcode ID type to support the format the BAdI requires. Now if you pass the ]C1 or ]d2 barcode id, the BAdI will activate and you can add your own code to convert it.

Thought I'd share our solution. If you have a better one, please post it.

james_tucker2
Explorer
0 Kudos

The BAdI gets called via PML if you pass the barcode ID in the Tag DataField "BARCODE". However, we have not yet determined how to get the Mobile UI to trigger the BAdI. We are still researching. If anyone knows the answer, please reply.

Former Member
0 Kudos

I have never used that BAdi, but regarding to where it is used. The conversion method will called from here:

/AIN/CL_PML_SENSOR_MAP -> method: PARSE_BARCODE -> line: 102

CALL BADI lo_badi->constr_id_from_bc_comp
            EXPORTING
              iv_bc_string    = <fs_bc_data>-fieldvalue
              iv_devgrp_extid = lv_devgrp_extid
              it_bc_part      = lt_pub_bc_part
            CHANGING
              cv_id_type      = lv_pub_id_type
              cv_id           = lv_pub_id.

Edited by: Philip Allgaier on Sep 28, 2011 5:32 PM

james_tucker2
Explorer
0 Kudos

Thanks for your reply Philip. Based on this, it seems this BAdI will only work with the Device Controller Interface and not the Mobile. I was hoping to use this BAdI when scanning the GS1_SER GTIN ID with the Mobile UI to convert the IDs to EPC_1.30 SGTIN-96 HEX since we receive the serial id in HEX from the device controller, but the serial id is printed in GS1_SER on the 2D data matrix.

JT

Former Member
0 Kudos

According to the BAdI documentation, it should also work for mobile devices, although I cannot really see where it should get called. Did you check out the prerequisites of the BAdI?