cancel
Showing results for 
Search instead for 
Did you mean: 

Display Barcode with multiple field values in SAP ADOBE form

uirji_netweaver
Participant
0 Kudos

Hi Team,

I have requirement the i need to display the Barcode with length of 6 with below field values

first 2 digits - current page numebr ( ex:01)

second 2 digits - Total pages count ( ex: 10)

last 2 Digits - last 2 digits of personnel number ( Ex: 23) ( this field im already getting in the layout)

so it need to concatenate 3 field values ( 011023 ) and display as barcode , iam aware of binding a single field and display as barcode , but how do i concatenate 3 fields and display barcode? do i need to write script or logic ? where i need add it? please advice?

Thank you

Nk

Sandra_Rossi
Active Contributor
0 Kudos

field, field, field, field and field...

But out of the 6 occurrences, one is correctly written 😉

Sandra_Rossi
Active Contributor
0 Kudos

Thanks for fixing the typos, but could you provide important information, because as I already said, it's not clear what knowledge you are missing:

  • Do a barcode?
  • Get the page number?
  • Bind barcode value to an ABAP variable?
  • Formatting number with leading zero if <= 9?
  • Concatenate strings?

Again, it's a question of type "this is my requirement, do everything for me" (although maybe the OP is missing only one tiny piece of information).

uirji_netweaver
Participant
0 Kudos

Thanks for the reply, I'm aware of binding and getting the current page number and count.

I have two different master pages and both have barcodes with little different values, i have added the script in both the pages. i was also to get the first 4 digits (please see the script below ) , now i need to add logic for last 2 digits, my issue is how to define and increment count across the both master pages that should increment the count until last page. that mean initiate the counter in first page and it should increment till last page (00,01...09).

i also noticed the output structure from program is in loop and the form interface is called 3 times, that mean it called each time for each PERNR. in the output spool there are total 9 pages and each 3 pages printing together.

Master page 1 logic

var pagen = xfa.layout.page(Ref($));
this.rawValue = concat(pagen , "01")
Master page 2 logic
var pagen = xfa.layout.page(Ref($));
this.rawValue = concat(pagen , "00")
do i need to add the logic to increment the counter in both the master pages ? so finally my bar code should be like below

Thanks

NK

uirji_netweaver
Participant
0 Kudos

Any idea on how to create counter and increment till last page ,

i created global variable LV_COUNT (default value 00) in form properties and added the logic to increment the count in both the master page , when i test i see for first document its printing right (010100,020001,020002) but for next page i see LV_COUNT value is resetting from 02 to 00 , may be because the adobe form call in loop, so all the values are resetting,

how do i store the counter value (LV_COUNT) until control come back for 2nd page ?

i really appreciate your help.

Thanks

NK

Accepted Solutions (0)

Answers (1)

Answers (1)

abo
Active Contributor
0 Kudos

In general, both providing a field with the concatenated values in the interface and creating it via scripting would work. In this specific case, at least one component is dynamic (current page) so your only option is scripting.

See here for an example or another one

uirji_netweaver
Participant
0 Kudos

Thanks for the reply , now my requirement is slightly changed , i need to count totally no. of pages for each PERNER instead of total pages in Spool, suppose there are total 9 pages and 3 PERNER are there , so each PERNER have 3 pages ,

ex: for first PERNR

first 2 digits - current page numebr ( ex:01)

second 2 digits - Total pages count for penner(03 )

last 2 Digits - there should counter , the value should increase for each page ( so end of the 9 th page it should be 09)

Please let me know how to write logic to count pages for each PERNER?

Thank you

NK

Sandra_Rossi
Active Contributor

c5e08e0478aa4727abc4482f5be390b2 even though the page number and total number of page varies, as the OP knows the final total number of pages, NK could do everything in ABAP without scripting anything (in case doesn't know how to script), and pass the values to the Adobe form.

010101

010202

010303

020104

020105

...

It's not clear what knowledge NK is missing.

Do a barcode?

Get the page number?

Bind barcode value to an ABAP variable?

Formatting number with leading zero if <= 9?

Concatenate strings?

Again, it's a question of type "this is my requirement, do everything for me" (although maybe the OP is missing only one tiny piece of information).

abo
Active Contributor
sandra.rossi

which is why I am done with the answer 🙂