Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Unbelievable ABAP oddity - SapScript related

Sappers,

I have officially come across the oddest ABAP problem that I have seen in 8 years. I've spent 8+ hours trying every possible code variation to get around it but nothing works.

Here's the story in summary.

We have an invoice with shipping fields NAME1, NAME2, NAME3, and NAME4. Under certain circumstances we need NAME1 to use a different field.

Our user-exit has worked perfectly since 2000 and is now acting odd after an upgrade to ERP6.

If I print a specific invoice, I get (using example data)

COMPANY NAME

123 STREET ADDRESS

CITY NAME ST 99999-0000

In the user exit the field NAME1 = 'COMPANY NAME'. I need it to say 'ALTERNATE COMPANY NAME' which resides in table ADRC. No problem, I pull that data into a variable and then overlay want is in the NAME1 var with what it in the ALT_NAME1 var so that NAME1 now says 'ALTERNATE COMPANY'. Great, no problems.

Here's the weird part. I don't expect you to believe me right off but please understand that I have gone through literally 50+ iterations to find out how to get around this behavior.

Printing the invoice ... I get.

123 STREET ADDRESS

CITY NAME ST 99999-0000

Whoops. Where did ALTERNATE COMPANY go? Let's try setting NAME1 to a hard-coded value like 'XXXXXXXXXX'.

Printing the invoice ... I get.

XXXXXXXXXXX

123 STREET ADDRESS

CITY NAME ST 99999-0000

Ok, we know the data element is getting through so why is the value 'ALTERNATE COMPANY' not making it to the form? Let's try this...

Rather than use the value of 'ALTERNATE COMPANY' that came in from ADRC instead I hard code NAME1 = 'ALTERNATE COMPANY'. A literal.

Printing the invoice ... I get.

ALTERNATE COMPANY

123 STREET ADDRESS

CITY NAME ST 99999-0000

What the?! It prints the value when I hard code the value but not when the same value comes from the database? True. I have tried every manner of manipulation on the NAME1 variable with no change in the behavior.

Here's a really odd behavior.

CONCATENATE 'X' NAME1 'Y' INTO NAME1.

At this point NAME1's value is 'XALTERNATE COMPANYY'.

Printing the invoice ... I get ... believe it ...

XY

123 STREET ADDRESS

CITY NAME ST 99999-0000

If I compare the value 'ALTERNATE COMPANY' that came from ADRC against a varaible with the literal 'ALTERNATE COMPANY' they are the same length and the hex codes are exactly the same as they should be. How in the name of all that is pure and good can ABAP print XY when the variable contains 'XALTERNATE COMPANYY' ?! Is this some kind of cruel unicode joke?

<< Removed >>

Thanks all,

Crew

Edited by: Rob Burbank on Apr 16, 2009 2:59 PM

Former Member
Former Member replied

hello,

you must consider that your exit ZXSADU01 is also called (again)

during sapscript command /: ADDRESS....

and I think address_number is empty during this command..

reagrds, darek

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question