Doubt on Quantity Field
Hi gurus,
I have one quantity field NSOLA in LTAP table for that fields there is reference field ALTME.
Now i am generating one ALV report.In that field catalog i mentioned as
wa_fieldcat-fieldname = 'NSOLA'.
wa_fieldcat-tabname = 'T_OUTPUT'.
wa_fieldcat-seltext_l = 'Quantity'.
wa_fieldcat-qtabname = 'LTAP'.
wa_fieldcat-qfieldname = 'ALTME'.
wa_fieldcat-col_pos = 5.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
like this, even thogh in o/p i get as 1.000 like that but i want the quantity as 1.
Please suggest me how to do this.
Thanks in Advance
Thanks and Regards,
Siri.....
Please check it
TABLES : mara.
DATA : BEGIN OF itab OCCURS 0,
matnr LIKE mara-matnr,
brgew TYPE p DECIMALS 0, " this qty file for mara table
sell(1),
END OF itab.
INCLUDE icons.
TYPE-POOLS : slis.
DATA : t_fieldalv TYPE slis_t_fieldcat_alv,
t_sort TYPE slis_t_sortinfo_alv WITH HEADER LINE,
import_variant LIKE disvariant,
xrepid LIKE sy-repid,
layout TYPE slis_layout_alv,
table TYPE c,
dbcnt TYPE i,
dbcntr(10) TYPE c.
DATA : events TYPE slis_t_event WITH HEADER LINE.
START-OF-SELECTION.
CLEAR : itab,itab[].
SELECT * FROM mara INTO CORRESPONDING FIELDS OF TABLE itab WHERE
matnr = 'A036119719501003'.
IF sy-subrc = 0.
PERFORM initial_alv_fieldcat CHANGING t_fieldalv[].
PERFORM layout_alv CHANGING layout.
PERFORM alv_display
TABLES itab
t_fieldalv
t_sort
USING 'Weld Process'
dbcntr
'Weld Process'
' ' "'status'
layout "'layout'
' '." usercommand
ENDIF.
*& Form initial_alv_fieldcat
text
<--P_T_FIELDALV[] text
FORM initial_alv_fieldcat CHANGING rt_fieldcat TYPE
slis_t_fieldcat_alv.
DATA: ls_fieldcat TYPE slis_fieldcat_alv.
DATA: i_color TYPE slis_t_specialcol_alv WITH HEADER LINE.
DATA:cntr TYPE i VALUE 1.
CLEAR : rt_fieldcat,rt_fieldcat[].
DEFINE fieldcat.
ls_fieldcat-fieldname = &1.
ls_fieldcat-seltext_m = &2.
append ls_fieldcat to rt_fieldcat.
END-OF-DEFINITION.
fieldcat 'MATNR' 'MATNR'.
fieldcat 'BRGEW' 'BRGEW'.
ENDFORM. " initial_alv_fieldcat
*& Form layout_alv
text
<--P_LAYOUT text
FORM layout_alv CHANGING p_layout TYPE slis_layout_alv.
p_layout-box_fieldname = 'SELL'.
p_layout-colwidth_optimize = 'X'.
p_layout-zebra = 'X'.
ENDFORM. " layout_alv
*& Form alv_display
text
-->P_ITAB text
-->P_T_FIELDALV text
-->P_T_SORT text
-->P_0111 text
-->P_DBCNTR text
-->P_0113 text
-->P_0114 text
-->P_LAYOUT text
-->P_0116 text
FORM alv_display
TABLES p_i_weldnew
p_t_fieldalv
p_t_sort
USING p_grid_title
p_count
p_title
p_status
p_layout
p_usercommand.
CONCATENATE p_title ' -
' p_count INTO sy-title.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER = ' '
I_BUFFER_ACTIVE = ' '
i_callback_program = sy-repid
i_callback_pf_status_set = p_status
i_callback_user_command = p_usercommand
I_CALLBACK_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME =
I_BACKGROUND_ID = ' '
i_grid_title = p_grid_title
I_GRID_SETTINGS =
is_layout = p_layout
it_fieldcat = p_t_fieldalv[]
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
it_sort = p_t_sort[]
IT_FILTER =
IS_SEL_HIDE =
i_default = 'X'
i_save = 'A'
IS_VARIANT =
it_events = events[]
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
IT_ALV_GRAPHICS =
IT_HYPERLINK =
IT_ADD_FIELDCAT =
IT_EXCEPT_QINFO =
I_HTML_HEIGHT_TOP =
I_HTML_HEIGHT_END =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
t_outtab = p_i_weldnew.
ENDFORM. " alv_display
Similar Messages
-
Reference table / reference field for currency/quantity field in tables.
Hello Sap Experts ,
Am a newbie and not able to make head or tail of what reference table and reference fields are when related to currency / quantity fields.Someone if could explain to me with a small example it would be great.Hi,
The currency and quantity field always require a reference table and field so that they can be entered in correct format.
Whenever you use currency and quantity field while creating the table you need to provide their respective reference field and table.
whenever you use currency and quantity in scripts or smart forms you again have to receive their value using variables referring to their reference table and reference field.
hope it must have cleared some of your doubts.
Thanks,
Abhi -
Hi experts
here in my quantity field there are units cm2(column centimeters) and WD(words) if u caluculate total on qty naturally it will display * is any possibilty there in report level to disply cm2 total seperately and WD total seperately if so tetll me the solution.
regards
anandHi Anand,
As you want the subtotals for the quantity and due to different units you are getting * values in the result, the suggested approach was to distinguish the records based on units. This can be achieved using restricted KF where we will restrict the KF on Unit. This will ensure that all the records with "for example KG" as unit will be restricted in one restricted KF. Same can be achieved for all other units.
This means you have to create 15 restricted KFs if you have 15 different units in the data. This will result in a bit slower response while executing the query with som many restricted KFs.
Hope this clears your doubt.
Regards,
Yogesh, -
Quantity fields not getting displayed in the second total row
Hi,
As per the requirement I have to display 2 total rows for an ALV report using CL_GUI_ALV_GRID. I am able to get the first total row properly using method get_subtotal(). However for the next total row only the character fields are getting displayed and the quantity fields are coming blank.
The second total row will have different values based on a formula.
Please help me out in resolving the issue.
Thanks,
AbhishekYou can provide first row as the SUBTOTAL and next row as the TOTAL.
Get one extra column on which you can do the SUBTOTAL.
Regards,
Naimesh Patel -
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. -
Make quantity field of Free goods as non-editable.
Hie!
I have free goods scheme of 9 + 1 .If quantity of main material is 10 then it will split into 9 + 1 where 1 is free of cost.
While making the sales order the free goods quantity field is editable. So the users are able to change the free goods quantity. I want to make this field as non-editable.
Please suggest how to do this.
Thankyou.Hi Pallavi
If you change the manual qty which is automatically determined by the system then there will be a message thrown by the system
Suppse in your case if 9+1 you change the qty manually to 2 from 1 there is a message V1 no 737 thrown by the system
You need to change the message class thro ABAP development only not possible thro customization
Not only this in delivery also it is possible to change the free qty and this also has to be controlled by the ABAPer only
Regards
Raja -
ALV QUANTITY field Geting converted into decimals ?
Hi All ,
I have developed an alv report .In that the quantity field is made editable after editing the quantity when i save it .It gets converted into decimals.Suppose if i give 77 its getting reflected as .077 all the field name ,table name ,reference field name, reference table name, quantity field data type has been passed but the problem persists.If there is any one whos has come across this kind of scenario please share your thoughts on this.
Best Regards,
SreeramHi Sreeram,
I am not gettin this issue. See below code :
If you are gettiing the same issue with the below code then it has something to do with your user settings.
Go to Menu Item System -> User Profile -> Own Data -> Defaults ->Decimal Notation.
Set it to 1,234,567.89 and save. Now try the program again.
REPORT z_test.
TYPE-POOLS: slis.
TYPES : BEGIN OF ty_ekpo,
ebeln TYPE ebeln,
ebelp TYPE ebelp,
ktmng TYPE ktmng,
menge TYPE bstmg,
END OF ty_ekpo.
DATA: it_ekpo TYPE TABLE OF ty_ekpo,
it_fieldcat TYPE slis_t_fieldcat_alv.
SELECT ebeln ebelp ktmng menge
FROM ekpo
INTO TABLE it_ekpo
UP TO 20 ROWS.
PERFORM add_fieldcat USING 'EBELN'.
PERFORM add_fieldcat USING 'EBELP'.
PERFORM add_fieldcat USING 'KTMNG'.
PERFORM add_fieldcat USING 'MENGE'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
it_fieldcat = it_fieldcat
TABLES
t_outtab = it_ekpo
EXCEPTIONS
program_error = 1
OTHERS = 2
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
FORM add_fieldcat USING p_fieldname TYPE slis_fieldcat_alv-fieldname.
DATA: wa_fieldcat TYPE slis_fieldcat_alv.
CLEAR wa_fieldcat.
wa_fieldcat-fieldname = p_fieldname.
wa_fieldcat-tabname = 'IT_EKPO'.
wa_fieldcat-ref_fieldname = p_fieldname.
wa_fieldcat-ref_tabname = 'EKPO'.
IF p_fieldname EQ 'KTMNG'.
wa_fieldcat-edit = 'X'.
ENDIF.
APPEND wa_fieldcat TO it_fieldcat.
ENDFORM. " ADD_FIELDCAT
Regards,
Jovito -
Hello All,
I am using OO - ALV in which I am displaying a quantity field.This field is an editable field and if user tries to change the value and SAVE , it is taking some wrong values.
Say suppose I am having 1.000 as the initial value and if user changes it to 2.000 and saves it is converted to .002.
I tried with qfieldname , ref_fieldname of fieldcat but of no use. Anything apart from this will be highly appreciated.
Regards,
DhwaniUser might be changing the value to only 2 and you might have declared the fieldcat with 2-3 decimal places. If you enter value with decimals say 2.001 it will take.
Otherwise you need to replace it with char value as Nanda has suggested.
Hope it helps.
Thanks,
Jayant -
I am using KWMENG data element in my ALV grid which is a quantity field. In normal dialog programming this field does not allows entering characters in editable cells. But in ALV grid I am not able to restrict it from entering characters.
Eg: In VA01 if we try to enter any character "ABC...Z" then it wouldn't be typed in the screen. But when using the same data element in ALV grid iot allows to enter alphanumeric values. Since it's a quantity field so character value gives a short dump. I know I can restrict the dump by using "NA" in comparing string but I want to knw is there a way by which I restrict character field entry in alv grid, the same way this field works in VA01. I checked with a simple dialog prog and in that also it doesn not allows character typing in editable fields.simple solution
mention the ref_fieldname and ref_tablename in the fieldcatalog for that column.
ex:
fieldcat-ref_fieldname = 'KWMENG'.
fieldcat-ref_tablename = 'VBAP'. -
Hi all.
we are phasing a problem.
I am using alv to display in output.
I am using a Quantiti field (BDMNG),.
in this field if nodata is there then it is showing 0.000(that is the default value).
I don't want those zeros.I want only space(blank only).
Can any body help me to solve this issue.
Thanks in advance
Eswar.Hai,
While building field catalog For quantity field Set the NO-ZERO attribute to 'X'.
Or you can change the quantity filed to character in the alv display.
Mark points if helpful.
Regards,
Umasankar -
Is is possible to display quantity field in FBU3?
Hi,
Is it possible to display the quantity field in FBU3? We have activated the quantity field for FBL3N but not able to find the configuration to do it for FBU3.
Please guide.Good Morning Everybody,
The above question still continues...
{Please Answer} -
Error with quantity field:Datasource Creation Using Function Module method
Problem with DATASOURCE Creation using Function Module method :
I have created a datasource ZSTANDARD_COST_PRICE using Function Module method . The datasource creation is successfull when I remove the quantity field from the Z table . If I dont remove the quantity field from my Z table it gives an error as "Units Field WAERS for field STPRS of datasource ZSTANDARD_COST_PRICE is hidden". I am not able to remove this error . Please someone guide.
Let me know if my explanation is not clear enough.
Thanks in advance,
Neha.
Z table definition is as below :
MATNR MATNR CHAR 18 0 Material Number
BWKEY BWKEY CHAR 4 0 Valuation area
LFGJA LFGJA NUMC 4 0 Fiscal Year of Current Period
STPRS STPRS CURR 11 2 Standard Price " Here the currency field is WAERS and table T001
PEINH PEINH DEC 5 0 Price Unit
VJSTP VJSTP CURR 11 2 Standard price in previous year
VJPEI VJPEI DEC 5 0 Price unit of previous year.
Edited by: Neha Rathi on Jan 30, 2009 3:03 PMHi,
You should add it as one of the main fields as you have added other fields and not as the currency fields...that is..it should be part of the data source and you should be able to see it in RSO2...
Also if added as i said then it will come as new field in the data source...you can either let it be there...or hide it..
also if you want to populate it then you will have to write the code for this fields as well.
Thanks
Ajeet -
Runtime error in Dynamic internal table with AMOUNT and Quantity Fields..
Dear friends,
I am attempting write a dymanic Select Statement (with joins).
And the sleect query looks like this..
SELECT (LT_SEL_LIST)
INTO CORRESPONDING FIELDS OF
TABLE <DYN_TABLE>
FROM (LT_FROM_LIST)
WHERE (LT_WHERE3).
Here the into table is a dynamically created internal table..
which is created by ...this
CALL METHOD CL_ALV_TABLE_CREATE=>CREATE_DYNAMIC_TABLE
EXPORTING
IT_FIELDCATALOG = IT_OUTPUT2[]
IMPORTING
EP_TABLE = DY_TABLE.
the it_output2 contains the the fieldcatlog information of dynamically given fields :-
like:-
TABNAME
FIELDNAME
DATATYPE
LENG
INTTYPE
ROLLNAME
DECIMALS
REFTABLE
REFFIELD
i mean the internal table is constructed with reference to all the bove metadata.
Problem:- This query run fine with all the fields Except AMOUNT AND QUANTITY fields....
When the selection list contain VBAK-NETWR or MSEG-MENGE..It throws a runtime error.
"The data read during a SLECT access couldnt be inserted into the target field,either conversion is not supported for
the target field's type or the target field is too short."
after this I even tried to construct the dynamic table with CFILEDNAME and QFIELDNAME in the Fieldcatalog.
so now my fieldcatlog looks like this:---
LOOP AT IT_DD03L..
IF IT_DD03L-DATATYPE = 'CURR'.
TABLEFIELD-CFIELDNAME = IT_DD03L-FIELDNAME .
ENDIF.
IF IT_FIELDCAT3-DATATYPE = 'QUAN'.
TABLEFIELD-QFIELDNAME = IT_DD03L-FIELDNAME .
ENDIF.
TABLEFIELD-TABNAME = IT_DD03L-TABNAME.
TABLEFIELD-FIELDNAME = IT_DD03L-FIELDNAME.
TABLEFIELD-DATATYPE = IT_DD03L-DATATYPE.
TABLEFIELD-INTLEN = IT_DD03L-LENG.
TABLEFIELD-INTTYPE = IT_DD03L-INTTYPE .
TABLEFIELD-ROLLNAME = IT_DD03L-ROLLNAME.
TABLEFIELD-DECIMALS = IT_DD03L-DECIMALS.
TABLEFIELD-REF_TABLE = IT_DD03L-REFTABLE.
TABLEFIELD-REF_FIELD = IT_DD03L-REFFIELD.
APPEND TABLEFIELD.
CLEAR TABLEFIELD.
ENDLOOP.
Note:- this is a test code so ignore performance issues...
Please help me with some code ...to avoid the Runtime erorr.
Thanks,
jeevan.Hi Jeevan,
Why are moving only few fields from DD03L table to your field catalog? Why don't you use move-corresponding? The following code works for me in ECC6.0.
data: it_dd03l type table of dd03l initial size 0,
ls_dd03l type dd03l,
lt_fldcat TYPE lvc_t_fcat,
ls_fldcat TYPE lvc_s_fcat,
ls_where(72) TYPE c,
lt_where LIKE TABLE OF ls_where,
lt_fld LIKE TABLE OF ls_where,
lt_data_dy TYPE REF TO data.
field-symbols: <ft_data> TYPE STANDARD TABLE.
select * into table it_dd03l from dd03l
where tabname = 'VBAK'
and ( fieldname = 'VBELN' or fieldname = 'NETWR' ).
check sy-subrc eq 0.
loop at it_dd03l into ls_dd03l.
move-corresponding ls_dd03l to ls_fldcat.
append ls_fldcat to lt_fldcat.
move ls_dd03l-fieldname to ls_where.
append ls_where to lt_fld.
if ls_dd03l-fieldname = 'VBELN'.
clear ls_where.
concatenate ls_dd03l-fieldname ' <> ''''' into ls_where.
append ls_where to lt_where.
endif.
endloop.
check not lt_fldcat is initial.
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
it_fieldcatalog = lt_fldcat
IMPORTING
ep_table = lt_data_dy
EXCEPTIONS
generate_subpool_dir_full = 1
OTHERS = 2.
IF sy-subrc <> 0.
RAISE no_configuration_data.
ENDIF.
ASSIGN lt_data_dy->* TO <ft_data>.
check sy-subrc eq 0.
select (lt_fld) from VBAK into corresponding fields of table
<ft_data>
where (lt_where).
Thanks
Bala -
Check on quantity field of co11n
hi all,
I want to display error messages when the quantity field at goods movement level of transaction co11n is 0 or space.
Find me the user exit or badi , but field exit is becoming complex as the screen is a table control.
help me.hi madhav,
CONFPP01 PP order conf.: Determine customer specific default values
CONFPP02 PP order conf.: Customer specific input checks 1
CONFPP03 PP order conf.: Cust. specific check after op. selection
CONFPP04 PP order conf.: Customer specific input checks 2
CONFPP05 PP order conf.: Customer specific enhancements when saving
CONFPP06 PP Order Confirmations: Actual Data Transfer
CONFPP07 Single Screen Entry: Inclusion of User-Defined Subscreens
CONFPS01 PS confirmation: Determine customer specific default values
CONFPS02 PS confirmation: Customer specific input checks 1
CONFPS03 PS confirmation: Customer specific check after op. selection
CONFPS04 PS confirmation: Customer specific input checks 2
CONFPS05 PS confirmation: Customer specific enhancements when saving
CONF0001 Enhancements in order confirmation
CONFPI01 Process order conf.: Calculate cust.specific default values
CONFPI02 Process order confirmation: Customer spec. input checks 1
CONFPI03 Process order conf.: Cust. spec. check after op. selection
CONFPI04 Process order conf.: Customer specific input checks 2
CONFPI05 Process order conf.: Cust. spec. enhancements when saving
CONFPI06 Process order confirmation: Actual data transfer
CONFPM01 PM/SM order conf.: Determine cust. specific default values
CONFPM02 PM/SM order confirmation: Customer specific input checks 1
CONFPM03 PM/SM order conf.: Cust. spec. check after op. selection
CONFPM04 PM/SM order conf.: Customer specific input check 2
CONFPM05 PM/SM order conf.: Cust. specific enhancements when saving
these are the list of userexits for the transaction co11n try keeping the break point in each user exit and check which suits your requirement.
the second method is you can do it by reading the documentation of the each exit.
Hope its clear to you,
Reward points fi usefull,
Thanks,
kalyan. -
How to make quantity field in puplic templates editable?
Hi SDN,
we are implementing SRM 5.0.
We have a change request to make the quantity field in public templates (or when you chose approved (old) shopping carts for a new order) ready for input.
What I tried so far is to go to the corresponding template, which is
SAPLBBP_PDH_SEARCH 4001 and exchange
`SUBLIST-QUANTITY[n].value`
by
<input type="text" name="SUBLIST-QUANTITY[n]" value="`SUBLIST-QUANTITY[n].value`">
Debugging the corresponding dynpro 4001 of function group BBP_PDH_SEARCH
PAI: MODULE mark_read_from_web.
there:
LOOP AT <sublist> INTO <lfs_sub_wa>.
shows, that the new quantity I might set on the webfrontend does not get transferred to <sublist>-quantity in the dynpro.
Even though in the debugger I manually changed the incoming quantity, it does not show up on the next webscreen with the shopping cart...
any ideas welcome,
regards, matthiasHi Atul,
the need for the requirement is very obvious, also we had this modification in the old release - and I am merely trying to rebuild it.
But for the business case: Just imagine you have 100 or more articles in a public template and maybe you have to chose new articles from different public templates. Then it is really painful if you have to recheck the shopping cart after you have filled it, just to change the quantities. This modification saves a lot of time and work for the users. Also I am wondering why it is not already standard behaviour.
regards, matthias
Maybe you are looking for
-
Have Pinned site shortcut open in full screen mode (not maximized)
Hello. I'm currently in the testing phases of migrating all of our users from a locally installed client version of their email to a web version of their email. I'd really like the webmail version to look more like an application than a website. I
-
Hello I have written a function at database. The function have 3 nested cursors. It was working fine till I made a small change, having a select statement and an addition of new column in already written insert statement. Now it have started giving m
-
LR3.3 Export to Facebook stopped working
I frequently load albums to Facebook using the plug-in. Tonight I got the following message: http://static.photoshop.com/products/lightroom/facebook_unavailable.html The Publish to Facebook service is no longer available. What's up with that? Does
-
10.4.10 Snap Crackle Pop iMac G5
I find random popping noises from the speakers out of my iMac G5, just as if the audio port was turning itself off and on in minute intervals. Drives me bonkers. I know they have a bug fix for the intel macs. I am wondering if anyone else has had thi
-
With Contract No I cannot download software..
My Contract No is 94424274 , this is for wireless product (AIR SAP1602i -n-k9) ,I cannot download Autonomous IOS for that , Plz tell me the details process to download .