Application Development 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: 

getting data from barcode into sap

Former Member
0 Kudos

hi friends,

any body have idea ,that after reading(scanning) the bar code we need to pick the barcode value into

our sap.shell i create any interface for this or sap provides any interface to pick the data into sap.will it possible to capture that into sap.please share your experience and suggestions.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

hi,

u can save urreading into text file then u can use

FM 'WS_EXECUTE' TO READ AND 'WS_UPLOAD TO SAVE THAT READINGS INTO SAP.

u can write code like this


refresh itab3.
clear itab3.

* Executing VB EXE file to get the weight from weigh bridge

call function 'WS_EXECUTE'
exporting

* DOCUMENT = ' '

* CD = ' '

* COMMANDLINE = ' '
inform = 'X'
cd = 'C:\SAPWEI'
program = 'C:\sapwei\MyVB.exe'

* STAT = ' '

* WINID = ' '

* OSMAC_SCRIPT = ' '

* OSMAC_CREATOR = ' '

* WIN16_EXT = ' '

* EXEC_RC = ' '

* IMPORTING

* RBUFF
* EXCEPTIONS

* FRONTEND_ERROR = 1

* NO_BATCH = 2

* PROG_NOT_FOUND = 3

* ILLEGAL_OPTION = 4

* GUI_REFUSE_EXECUTE = 5

* OTHERS = 6
.

* IF sy-subrc 0.

* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

* ENDIF.

* Fetching Value from VB text file
call function 'WS_UPLOAD'
exporting

* CODEPAGE = ' '
filename = 'C:\sapwei\w1.txt'

* FILETYPE = 'ASC'

* HEADLEN = ' '

* LINE_EXIT = ' '

* TRUNCLEN = ' '

* USER_FORM = ' '

* USER_PROG = ' '

* DAT_D_FORMAT = ' '

* IMPORTING

* FILELENGTHtables
data_tab = itab3

* EXCEPTIONS

* CONVERSION_ERROR = 1

* FILE_OPEN_ERROR = 2

* FILE_READ_ERROR = 3

* INVALID_TYPE = 4

* NO_BATCH = 5

* UNKNOWN_ERROR = 6

* INVALID_TABLE_WIDTH = 7

* GUI_REFUSE_FILETRANSFER = 8

* CUSTOMER_ERROR = 9

* NO_AUTHORITY = 10

* OTHERS = 11
.
if sy-subrc 0.

* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
loop at itab3.
v1 = itab3-num.
pgrwt = v1.
endloop.
message 'Save Gross Weight' type 'S'.
endform. " grosswt

14 REPLIES 14

Former Member

0 Kudos

thank u but i can create bar codes , problem is reading those into sap.

Former Member
0 Kudos

Hi,

You do need an interface. Something like a vb script which would get the data into an excel,notepad file where it can be uploaded.

But in some case as if you have to read, for example, a barcode that holds the legal number of an invoice using a barcode scanner and this number should be sent to migo-> bktxt then you don't need an interface. The scanner itself acts like a fast operator entering the characters using a keyboard and filling in the field. Hope this helps.

Thanks

Former Member
0 Kudos

Hi,

Try with BAPI -- BAPI_BARCODE_SENDLIST

Thank you,

Sekhar.

Former Member
0 Kudos

Hello,

Kindly go through the following link.

http://www.sap-img.com/abap/details-information-about-sap-barcodes.htm

regards

0 Kudos

thanks for your reply ,but above link is for creating barcodes.

Edited by: sudheer b on Apr 15, 2009 1:45 PM

Edited by: sudheer b on Apr 15, 2009 2:04 PM

Former Member
0 Kudos

hi,

u can save urreading into text file then u can use

FM 'WS_EXECUTE' TO READ AND 'WS_UPLOAD TO SAVE THAT READINGS INTO SAP.

u can write code like this


refresh itab3.
clear itab3.

* Executing VB EXE file to get the weight from weigh bridge

call function 'WS_EXECUTE'
exporting

* DOCUMENT = ' '

* CD = ' '

* COMMANDLINE = ' '
inform = 'X'
cd = 'C:\SAPWEI'
program = 'C:\sapwei\MyVB.exe'

* STAT = ' '

* WINID = ' '

* OSMAC_SCRIPT = ' '

* OSMAC_CREATOR = ' '

* WIN16_EXT = ' '

* EXEC_RC = ' '

* IMPORTING

* RBUFF
* EXCEPTIONS

* FRONTEND_ERROR = 1

* NO_BATCH = 2

* PROG_NOT_FOUND = 3

* ILLEGAL_OPTION = 4

* GUI_REFUSE_EXECUTE = 5

* OTHERS = 6
.

* IF sy-subrc 0.

* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

* ENDIF.

* Fetching Value from VB text file
call function 'WS_UPLOAD'
exporting

* CODEPAGE = ' '
filename = 'C:\sapwei\w1.txt'

* FILETYPE = 'ASC'

* HEADLEN = ' '

* LINE_EXIT = ' '

* TRUNCLEN = ' '

* USER_FORM = ' '

* USER_PROG = ' '

* DAT_D_FORMAT = ' '

* IMPORTING

* FILELENGTHtables
data_tab = itab3

* EXCEPTIONS

* CONVERSION_ERROR = 1

* FILE_OPEN_ERROR = 2

* FILE_READ_ERROR = 3

* INVALID_TYPE = 4

* NO_BATCH = 5

* UNKNOWN_ERROR = 6

* INVALID_TABLE_WIDTH = 7

* GUI_REFUSE_FILETRANSFER = 8

* CUSTOMER_ERROR = 9

* NO_AUTHORITY = 10

* OTHERS = 11
.
if sy-subrc 0.

* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
loop at itab3.
v1 = itab3-num.
pgrwt = v1.
endloop.
message 'Save Gross Weight' type 'S'.
endform. " grosswt

0 Kudos

thank u ,but we need not to execute from sap , he externally scan the barcode with scanner .

when he scanned it, it will automatically get into sap. that is the requirement.

Former Member
0 Kudos

hi friends ,

any updates on this thread,

0 Kudos

U need a RF gun ,load the SAP console into that . It will read ur barcode data for the appropriate fields on screen. We did that for Warehouse Management there we used LM01 transaction. U need not code anything for barcode reading. The Basis guy will take care of configuring ur SAP in the RF gun, u can run ur SAP transaction on the RF device.

0 Kudos

Hi thank u very much,

will it works for any transaction ? or only for warehouse management tcodes ?

0 Kudos

Technically it should work for any transaction.

0 Kudos

ok could u please tell me any other information regarding this ? what are the prerequisites for this ?

Former Member
0 Kudos

Hi

Check this function module /AIN/UI_BARCODE_AI_SCAN

otherwise in SE37 search for the function modules corresponding to barcode identifiers and to get values of barcode.