ALV: get zeroes in character field.
Hi,
I'm trying to get a field defined in my structure as char 18 and set for input in my alv. Unfortunatly if I insert 00012345 I receive in my internal table 12345. For updating my internal table I use:
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR' IMPORTING e_grid = lo_grid.
CALL METHOD lo_grid->check_changed_data( ).
I hope in your help.
Thaks.
Giovanni
Hi,
sorry again for the trouble but I can't solve my problem at the moment. I wish to get any value from my alv field. More example if the length of the field is 18 characters and I fill it with 000123, I wont to have in my internal table the seme value.
1) I have executed the fm 'CONVERSION_EXIT_EAN11_INPUT' passing '123456' because I receive this value from the alv and I obtain the same value in output
2) I have defined my fied EAN in my structure as type ZZZEAN as data type -> predefined type SSTRING length 18 and I have activated it. When I try to activate my structure, I receive these errors.
- Current enhancement category Can Be Enhanced (Numeric or Char. Type) is incorrect
- The following enhancement categories can be selected:
- Cannot Be Enhanced ,Can Be Enhanced (Deep)
Any help will be well appreciated.
Thanks.
Giovanni
Similar Messages
-
Add leading zero for character field on ALV
hi all ,
i am currently making an ALV report. i have a field which is 'rassc' char(6) in the internal table which should be shown on the report.
before i use function to show alv report , i saw the value of this field is '080' , but what i get on the report is '80'. i want the leading zero . but i don't know how .
plz guide me.
regards
Kevinhi,
check this.
DATA:
var TYPE matnr.
WRITE '80' TO var RIGHT-JUSTIFIED.
TRANSLATE var USING ' 0'.
WRITE: var. -
SQL*Loader sqlldr removes zeros from character field
Hello,
I am using SQL*Loader to load an Oracle table, and am having a problem. One of the fields is defined as VARCHAR2 and contains comments entered by a user. There may be numbers or dollar amounts included in this text. When I execute the sqlldr script below, the result is that all of the zeros on the text field disappear. There is a translate function invoked for this field (bolded statement) in an attempt to remove imbedded newlines from the text. Wherever there was a zero in the original text, it ends up being removed after I run this script. Can anyone suggest why this is occurring, and how to prevent it? Can it be related to the translate function?
Thanks for your help!
OPTIONS (READSIZE=20971520, BINDSIZE=20971520, ROWS=20000)
LOAD DATA
INFILE 'R24.REGION.ERL.N1E104' "str X'5E5E220A'"
BADFILE 'LOGS/N1E104_BUT_RS_ASSGN_TXT_BADDATA.TXT'
DISCARDFILE 'LOGS/N1E104_BUT_RS_ASSGN_TXT_DISCARDDATA.TXT'
REPLACE
INTO TABLE TESTM8.CONV_BUT_RS_ASSGN_TXT
FIELDS TERMINATED BY '~' OPTIONALLY ENCLOSED BY '"'
TRAILING NULLCOLS
RST_RS_EXT_TXT_OID DECIMAL EXTERNAL,
RST_RS_ASSGN_OID DECIMAL EXTERNAL NULLIF RST_RS_ASSGN_OID = 'NULL',
RST_TXT_SEQ_NBR INTEGER EXTERNAL,
RST_RS_COMM_OID DECIMAL EXTERNAL,
RST_DIF_ASSGN_OID DECIMAL EXTERNAL NULLIF RST_DIF_ASSGN_OID = 'NULL',
RST_EXTENDED_TXT "SUBSTR(TRANSLATE(:RST_EXTENDED_TXT, '#0x0A', '#'), 1, 248)"
--------------------------------------------Never mind, found my mistake. In the TRANSLATE function, I had assumed that the 0x0A would be interpreted as a single hex value. Instead, it is interpreted literally as the character '0', the character 'x', the character 'A', etc. The result is that the transformed text had no '0', 'x', or 'A' characters, which is exactly what I inadvertently told it to do. I changed it to the following, which works better ;-)
RST_EXTENDED_TXT "SUBSTR(TRANSLATE(:RST_EXTENDED_TXT, '#'||CHR(10), '#'), 1, 250)" -
Padding character fields with zeros
Hello,
I need to add zeros to the end of character fields TYPE C. I know i can use the conversion routines but that only works for numeric fields.
ThanksThanks for all the replies.
STRLEN will give me the lenght of the field but i need the offset of the last chararcter.
Your post gave me an idea though. I'm doing the following and it's working.
value = 'Thank You '.
tmp = '00000000000000'.
FIND REGEX `\w[ [:space:] ][ [:space:] ]` IN value MATCH OFFSET moff.
IF SY-SUBRC = 0.
OVERLAY value+moff WITH tmp.
ENDIF.
The find looks for the last alphanumeric char and 2 spaces after it meaning the last alphanumeric char in the string.
Thanks to all, i will reward as fairly as possible. -
How to get a currency format for a character field
for some specifix reason, we have a requirement to show character field (which results in value 633948) in the format $633,948
how do i do this?
if i do SELECT to_char(:c_1,'$999,999')) from dual;
it gives me ora: 01722: invalid number error
c_1 is a user parameter of data type characterTry using TO_NUMBER first, as in something like:
SQL> VARIABLE c_1 VARCHAR2(6)
SQL> EXECUTE :c_1 := '633948';
PL/SQL procedure successfully completed.
SQL> SELECT TO_CHAR(TO_NUMBER(:c_1), '$999,999') FROM DUAL;
TO_CHAR(T
$633,948Hope this helps. -
ANY FUNCTION MODULE TO ADD LEADING ZEROS FOR A CHARACTER FIELD
THE CHARACTER FIELD IS OF LENGTH 40 AND IT HAS 5 NON NUMERIC CHARACTERS
Hi ,
Try this
DATA : c4(40).
data : P_FIELD(40) TYPE N.
UNPACK P_FIELD to c40.
<b>Reward Points if useful</b>
Regards
Saket Sharma -
Getting zero(0) value as a output of a formula while both fields have values.
Hi All Crystal experts,
I have a report which has 2 groups, one on month(post_date) and another one on month_number. Now I am showing some aggregate values like sum(invoice_total), sum(Cash_total), sum(Open Item) etc which are sorted and grouped by month(post_date) for each month.
I have one formula in my report that is:
if @invoice_total = 0 then 0 else (@Cash_total) / (@invoice_total). None of my fields shows zero value in result but output of this overall formula is coming zero in the report.
I did like this also,
if @Cash_total= 0 then 0 else (@Cash_total) / (@invoice_total). But output of this formula also shows zero. while both fields have values
Could anybody help me on this. How to resolve this issue?Hi Remi,
Modify the @MonthlyDSO formula to:
numbervar Inv_Total;
numbervar Cash_Total;
Inv_Total := (if {FIAR_C03E_BO_FIAR_SUMMARY_RPT3.[0AC_DOC_TYP]-[20AC_DOC_TYP]}in ["J1", "J2", "J6"]
and {@PostDate} in {?StartPostDate} to {?EndPostDate}
then {FIAR_C03E_BO_FIAR_SUMMARY_RPT3.[Measures]-[009ZV74NDTN2BLLNWOYHGPPU5]} else 0;);
Cash_Total := (if {FIAR_C03E_BO_FIAR_SUMMARY_RPT3.[0AC_DOC_TYP]-[20AC_DOC_TYP]} in ["DL", "DW", "DC"]
and {@PostDate} in {?StartPostDate} to {?EndPostDate}
then {FIAR_C03E_BO_FIAR_SUMMARY_RPT3.[Measures]-[009ZV74NDTN2BLLNWOYHGPPU5]} else 0) * -1;
if (Inv_Total) = 0 then 0 else(Cash_Total / Inv_Total) * {@Days in period}
-Abhilash -
Hi all,
Is there any way to have filter on character fields to get the data even if the input is not given without padding zeroes before the data. for eg in ALV grid display if the data is having 7 characters but total field length is 10 chars then in filter we have give 3 zeroes leading to the data to get the filtered condition. is there any way to avoid this so that the users can give directly the data without leading zeroes.Hi sathya,
in your itab declare the same field referring to Db table.
this will take care of the padding of zeros as alpha routine is applied on that filed.
so the user can proceed with the same by not giving the input padded with zeroes.
below code will give u an idea.
data : val1 like vbak-vbeln value '0005002030'.
data : val(10) type c value '0005002030'.
write:/ val.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = val
IMPORTING
OUTPUT = val.
write:/ val.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = val1
IMPORTING
OUTPUT = val1.
write:/ val1.
i agree with anurag ..
regards,
VIjay -
How can we remove the following zeros from quantity field ?
Hi All.
how can we remove the following zeros from quantity field while populating ALV by using FM REUSE_ALV_GRID_DISPLAY ?
eg:getting output zqty = 2.000
but i need zqty = 2.
help me to reslove this issue.
Regards.
jayHi,
While populating the field catlog do the following thing to avoid zeros.
wa_fieldcat-tabname = 'I_OUTPUT'. " Curr
wa_fieldcat-fieldname = 'FWAER'.
wa_fieldcat-seltext_l = text-023.
wa_fieldcat-no_zero = 'X'.
APPEND wa_fieldcat TO i_fieldcat.
CLEAR wa_fieldcat.
Thanks,
Khushbu. -
How to sort a character field with numbers and letters on the end
I have an internal table with character field which has data like this after I sort it. This is not what I expect from the sort.:
13A
15A
29A
30A
31A
33A
123A
125
62
76
94A
I expect this, which is sorted number first, then alpha. Any ideas how to get this sort?:
13A
15A
29A
30A
31A
33A
62
76
94A
123A
125Thanks for the suggestions. After reading the suggestions and reviewing some other post threads, here's what I did to get the sort to work:
Add a dash - to the end of any record that did not have an alphabet character at the end. This way, all records have at least one non-numeric character at the end. Then I overlayed zeros '0000000' over each record. Then I sorted the table. Afterwards, I removed the dashes and zeros.
The long way around, but it worked for me. Since the internal table is processed in memory, it doesn't add much overhead to the run time. -
Only zeros in ALEAUD field E1ADHDR / E1STATE / DOCNUM
Hi,
i m working with a scenario SAP ECC 7.0 -> IDoc -> PI -> IDoc -> R/3 4.6c
I m sending a purchase order (ORDERS.ORDERS05) from SAP ECC and i want to receive an acknowledgment from R/3. Unfortunately there are only zeros in the field E1ADHDR / E1STATE / DOCNUM, this leads to the error "ALEAUDIT IDoc cannot find request IDoc in Integration Server" on PI.
Does anybody know what to do in the R/3 system to send the original IDoc number in E1STATE / DOCNUM?
Regards,
UdoHi Alexander did you get to solve the problem with the empty DOCNUM field in ALEAUD?
In your first post you stated that you were dealing with an IDoc-to-File scenario but then you mention that JDBC adapter doesn't support acknowledgements. I found that a bit confusing.
I managed to get system acknowledgements from File adapter but the ALEAUD idoc received by R3 is missing some fields (like DOCNUM and STATXT) in E1STATE segment.
Can somebody enlight me with this problem without posting any link (i have already visited all of them without an answer to my question).
Thanks in advance,
Nicolá -
How do I zero-fill a field in a Presort Output file?
Hello,
I am trying to zero-fill a field in my Presort address output file. For example, instead of posting ap.pc_no_abs as "1", I need to post it as "00000001"
Thank you,
Dawn DeemsDawn,
Below are some examples of how to pad data when posting to output:
To right justify data in a character-type field:
In the Post to Output File block, place the following filter(s) to achieve your desired result:
To prepad with leading "spaces" for a total length of 10:
right(" "+alltrim(AP.Field_name), 10)
To prepad with leading "zeros" for a total length of 10:
right("0000000000"+alltrim(AP.Field_name), 10)
Thanks,
Kendra -
Character field in excel output exist some junk character's
PlatForm :IBM630,PC
Operation System:windows xp,windows 2003,AIX 5.3
IAS version :10.1.2
Language :Chinese
When set desformat parameter equal to spreadsheet, character field in excel output exist some junk character's,
and as excel output data gather volume,junk character's will more and more.
But when I only get the record include junk character's,then the excel output will be ok.
How can I do to solve the problem?
Thanks in advance!
lind
Message was edited by:
user565112PDF,RTF DESFORMAT is right,but users need spreadsheet desformat too.
the characterset is unicode,and end signal of junk character is ?/SPAN>.
When I get excel output include junk character,the same time get the junk character's record,and then get excel output only include the junk character's record,the excel output will be showed correctly,no junk characters.
How to sovle the problem?
thanks.
Message was edited by:
user565112 -
In WebI report, is that possible to show ZERO in NULL fields?
in WebI report, is that possible to show ZERO in NULL fields? crystal report has no issue, but i could not find a way to set ZERO to NULL field
can you tell?Bram,
This formula you used above is corrcet but is returning you a character '0' and when a descending sort is applied character values will be at the top.
So , apply the formula 'ToNumber' on the value returned form the above formula :-
ToNumber(above formula)
And then it will change 0 to number and give you the exact sort order.
Thanks,
Rohini Haksar -
Last Column of ALV gets compressed
HI ,
The last column of ALV gets compressed when I manually set my widths to my fields.
I have a comments section in my Table when the data is huge, So I have to set the width of the field so that the table does not look odd.
But when I add the same, the last field of my ALV gets compressed. I added one last field to the same ALV table, and last added field is compressed.
My code for setting the ALV data is as follows.
lo_table_settings->set_fixed_table_layout( abap_true ).
LOOP AT t_column INTO w_column.
IF w_column-id = 'COMMENTS'.
lr_textview ?= w_column-r_column->get_cell_editor( ).
lr_textview->set_wrapping( abap_true ).
lr_textview->set_design(
value = cl_wd_text_view=>e_design-label_small
w_column-r_column->set_width( value = '600' ).
ELSE.
w_column-r_column->set_width( value = '100' ).
lr_header = w_column-r_column->get_header( ).
lr_header->set_header_text_wrapping( value = abap_true ).
ENDIF.
ENDLOOP.
Please help me in this regard.Hi Rama,
The last column of ALV is compressed, the Width of last column is so small that the table looks very awkward.
The complete data is shown, no data is truncated.
I already set the condition you mentioned. I placed the same in code in my post.
Maybe you are looking for
-
How do I sync photos from Iphone to Ipad?
How can I sync photos from Iphone 4S to Ipad 4th generation?
-
How to hide video files in Playbook
I want to hide some of the videos to hide from my kids. There is no such option that any particular video file doesnt show in the videos list. Insted, if there is any option to hide the icon of the video from the menu, just like option in the Bold 4
-
Eq app for iPhone II for both headphones and Bluetooth?
I use my iPhone II on headphones and streaming to my Bose Soundlink II via Bluetooth, I need a simple sound equalizer app that works in both situations? I have iOS 4.2.1. I did a search at iStore but most apps are for later iOS. The iPhone iPod has a
-
I'm trying to figure out how I can determine what the DNS servers are for a given machine using Java. I can determine the local hostname easily enough, but how can I determine where it's looking for DNS? Thanks so much! Eddie
-
Update MAC 10.5.8
Hi HAve just bought the kids new ipods but I can't download their old music onto them as I have not continued to update my MAC 10.5.8. Apple shop told me to contact Apple and buy for less than $20 an update. Apple online wants want $59 just to talk t