Concatinating of fields in ztable
Hi experts....
I have one z table in this it has 8 fields, when user enters data in the first 7 fields at sm30, than that data will be concatinated with the "/'" mark in 8 th field.. please help me to solve this....
You may have to do this in a slightly roundabout way.
Instead of having the user enter into table entry through SM30, you would need to write a program that calls transaction sm30 from inside. Attach a transaction code to your program and ask the user to use this in place of SM30. Once the user is done and presses back, the control is back in your program. Now you can programmatically do the concatenation and inclusion of other characters into the 8th field and do a bdc all transaction SM30 to update with the calculated value.
I would assume there is some purpose why this is being done. So, as a sweetener your program may trigger the next step after your 8th field update has completed.
The assumption above is, the table has not many rows [10K or less] you can read all entries of the table to carpet bomb with 8th filed creation for all rows every time. Else it is tricky to figure out which ones changed in the latest update. If you have to do that, look at SCU3 and the SAP standard report program under "Evaluate Logs" button, with your table having "Log Data Changes" checked in table technical settings and your Basis folks permitting table logging.
Similar Messages
-
To add fields form ztable to VA01
Hi All,
I need to add some fields from ZTABLE to transaction va01 and i want to store
data entered in that fields.
So that dat should be saved in ztable or stadard table by doing Append structure .
And wt code shall i write for saving that data and where it should be added.
Thanks in advance.
AniketHI,
Hi,
You can do this by implementing one screen exit and couple of usr-exit. For all of the exits given describing below you will need access key.
1. Field you want in VA01 line item, add them to table VBAP using append strucutre.
2. You can not show additional fields to the in VA01 where all the lines are display, instead you add the fields on "Additional data B" tab at line item level. To see the Additional data B screen, you can either double-click any line item and go to the very last tab OR use the menu path "Goto -> Item -> More functions -> Addition data B"
The screen for "Additional data B" is SAPMV45A 8459. Use transaction SE51 to implement this screen. Add these fields as a dictionary fields ( with reference to VBAP custom fields you have defined ).
3. To implement PBO logic of this screen, you will have to use include MV45AOZZ. This will require access key.
4. To implement PBI logic of this screen, you will have to use include MV45AIZZ. This will also require access key.
Please refer to following link for more information on "User-exit in sales document processing"
http://help.sap.com/saphelp_46c/helpdata/en/1c/f62c7dd435d1118b3f0060b03ca329/frameset.htm
Regards
Sudheer -
F4 help for month and Year field in ztable please
I have created a ztable.
The first field in my ztable is a primary key field and it holds MM/YYYY(eg. 08/2011).
How ever my requirement is when ever we want to see the output, uer wants F4 help on that fields and when he selects the range , the ztable should display the values in that range.
For eg.
1). if user selects 01/2011 to 08/2011 using F4 Help,
2). then the ztables should display all the records in that range.
Thanks in advance for your help.
Best regards,Sam
Moderator message : Spec dumping / Outsourcing is not allowed. Thread locked.
Edited by: Vinod Kumar on Aug 8, 2011 11:17 AMHi Sam,
Create an F4 help using this FM
l_t_date" has month and date
l_f_programm = sy-repid.
l_f_dynnr = sy-dynnr.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'Date'"Field name of coloum of value tab
dynpprog = l_f_programm
dynpnr = l_f_dynnr
dynprofield = <>"Screen field name'
value_org = 'S'
callback_program = l_f_programm
callback_form = ''
TABLES
value_tab = l_t_date"Value table for date and month
* FIELD_TAB = L_T_RETURN
return_tab = l_t_return_tab
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
READ TABLE l_t_return_tab INDEX 1.
IF sy-subrc = 0 .
<fields> = l_t_return_tab-fieldval.
ENDIF.
Regards,
Amit
then filter the ztable accordingly -
Adding a New Field to Ztable...Missing in SM30
I added a new key field to a Z table. When I do an SM30, or the already created custom transaction to maintain te table the key field is not there.
I even did an SE14 and did an "adjust" to the Ztable...No luck the key field is not there. However, when I do an SE16 to view the table, I see the added key field, blank of course.
What step did I miss?
Thank-YouHi,
You have to re-generate the Table maintenance..
Go to SE11..
Give the table name..Press change..
In the menu..UTILITIES -> TABLE MAINTENANCE GENERATOR..
Press change (pencil button)..
Press expert mode..Press select all..
Press enter.
It will re-generate the table maintenance..
Thanks,
Naren -
Auto populate for fields in ZTable
Hi
I created a Z Table with 10 Fields,Out of those 2 fields are timestamp and Created by.
Timestamp and Created by are made Output only fields in Table Maintenance Generator
SE11> ZTable>Table Maintenance Generator>Environment>Modifications-->Events
Type -5 concatenate sy-datum sy-uzeit into ZTable-Timestamp.
With which when user performs a manual posting in the table and save a record in SM30 the Timestamp is populated automatically.
Similar to these how can i Auto Populate the Created By with the user id (logon id) of the user who made the posting.
I tried to create a new event of type-5 - System is not allowing me to create a event another event of same time
How can i enhance the exisisting event so that i can get Auto Populate of Created By
Thanks in advanceHi friend,
Put your code which populate user name inside form of event 5 (maybe below your existence code).
regards, -
Search help for a field in ztable
Good day everyone!
I want to create a search help for a field. I have a field 'country' in my Ztable. Now I want to create a search help for that field so that they appear in the SM30 transaction while entering the data into the table. How can I do that?
thanks.First of all if the field is country and you want to display all the countries avaiable in SAP in the search help then yuo dont need to create search help for that. For that field put the data element LAND1. The F4 help will automatically appear in SM30 and when you press F4 all the countries will be displayed in the hit list.
Now suppose there is a case where you want to display selected values only and not all the countries in your search help then one way is to create a z-table of countries and put all the countries you want in that table then create z-data element and z-domain for that country field and in domain give the table as a value table.
Another way is to create a view for T005 and T005T table and give the selection conditions as per your requirement and then create the search help with this view and attache the search help to your country field. -
Hi,
i´m developing a ZTABLE. In this ztable there are two key fields. One of them (
ZNUMDE) must be the result of concatenating sy-uname(3) sy-datum+2(2) and a secuential
number of 2 digits the moment the entry is created.
This key field must distinguish the number of entries in the table by user.
e.g. user PETER has 2 entries -> 1st ZNUMDE = PET0501
2nd ZNUMDE = PET0502
for user JOHN (1 entry) -> ZNUMDE = JOH0501.
In order to achieve this i´ve created a maintenance view of the table and within the event '01' BEFORE SAVING IN THE DATABASE i´ve created a routine within which i´ve added the following code: DATA: v_max(2) TYPE i,
v_numde(7) TYPE c,
v_conta(2) TYPE c.
CLEAR: v_max, v_numde, v_conta.
Here i check the number of entries of a the user
SELECT COUNT( DISTINCT usuar ) INTO v_max
FROM ZTABLE WHERE usuar = sy-uname.
IF v_max GT 0.
v_max = v_max + 1.
v_conta = v_max.
ELSE.
v_max = 1.
v_conta = v_max.
ENDIF.
SHIFT v_conta RIGHT.
REPLACE '' WITH '0' INTO v_conta.
CONCATENATE sy-uname(3) sy-datum+2(2) v_conta
INTO z_v_devolucion-numde.
z_v_devolucion-usuar = sy-uname.
The question is that thus i´m not able to get ZDEVNUM as desired.
Any suggestion?
Best regards.Hi!
It would be easier, if you had described your current (wrong) result.
But my guess is, your not counting existing entries correctly.
Your key znumde has three parts: user, year and counter. In your select, you define just user, but not year.
But when you have already second field usuar (why not user?) for user-id, why not split your key into three separate fields? This would make your selection easier:
select count( * ) into v_max
from ztable
where user = sy-uname
and year = sy-datum+2(2)
and (other key except counter).
By the way: you create a year 2100-problem!
Use v_max type i instead of v_max(2).
with v_conta(2) type n you might get correct format without additional conversion. Otherwise FM CONVERSION_EXIT_ALPHA_INPUT will do the job, too.
Or do you struggle with the event?
Regards,
Christian -
Declaring a text field in ztable
dear all,
iam trying to declare a text field for inserting comments in a ztable. first iam declaring it in a code and updating it in to a ztable through program. this text field is given in alv as edit mode than tere some text is maintained in output(i.e in editable alv) than user when clicks save than total records r updated to ztable.
my problem is that this text field is taking only 5 to 6 letters as input.
With regards,
Prasadbabu.Hi,
While building a fieldcatalogue for output table set the parameter OUTPUTLEN of fielcatalogue equal to the lenghth of the number of characters u want to enter.This will allow u to enter as much characters u want.
i_fieldcat TYPE STANDARD TABLE OF lvc_s_fcat,
wa_fieldcat LIKE LINE OF i_fieldcat.
wa_fieldcat-outputlen = '20'.
APPEND wa_fieldcat TO i_fieldcat.
Hope this Helps!!!!!!!!
Edited by Tejaswini Khante -
What should be the data type for a field in ztable?
i am desing a ztable , wht should be the datatype for a field if i want to enter values like -1.5 and -2.5 , negative values with decimals what should be the data type???
declare as P type. TYPE P DECIMALS 1
Type P data allows digits after the decimal point. The number of decimal places is generic, and is determined in the program. The value range of type P data depends on its size and the number of digits after the decimal point. The valid size can be any value from 1 to 16 bytes. Two decimal digits are packed into one byte, while the last byte contains one digit and the sign. Up to 14 digits are allowed after the decimal point. The initial value is zero. When working with type P data, it is a good idea to set the program attribute Fixed point arithmetic.Otherwise, type P numbers are treated as integers.
You can use type P data for such values as distances, weights, amounts of money, and so on.
Also check this link.
http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb2fd9358411d1829f0000e829fbfe/content.htm
Regards,
Maha -
Hi add fields in ztable user name system time and date urgent
i have to add three new fields in my z table
a)user name
b)system time
c)date
suppose if anyone update my ztable then the above three fields should catch the values as which user change the ztable at what time and on which date
plzzzzzz help
urgent
saurabhTo create the fields use the following field types.
CPUTD - for Date
CPUTM - for Time
USNAM - User name.
when updating the table pass the system variable.
sy-datum - for date
sy-uzeit - for time
sy-uname - for user name -
Adding some fields to ztable.
Hi friends,
i want to add menge from mseg table and lbkum from mbew table into my ztable which has MANDT TEMPLATE ITEM PHASE
MATERIAL MFRNR these fields but at the appending it is giving error that Error in ALTER TABLE generation for table ZPSYS
can you please tell me how can i rectify this error?
Regards,
bikashHi in SE11 ,
Use menu as below.
UTILITY----
>DATABASE OBJECT......>DATBASE UTILITY......>ACITIVATE NAD ADJUST DATABSE.
then Click on YES
Press F3 and acivate your table.
Cheers,
Pravin -
How can we hide the key fields of ztables in sm30 display?
experts.. pls help me....
Hi,
Use events in table maintenance generator '05' and write the code.
Go to se11-table name-utilities-table maintenance generator-extras-events in table maintenance generator . In the source code
Put form hide.
<code>.
endform.
Or.
In SE80
Goto Function Group
Then click on Screen
Then click on Element List Tab
Below u can see list of ur fields strting with ZTT-......
And against that u can have to uncheck the checkbox in INPUT column ......
So that the input for the field will be disabled..... when u go in edit mode......
Regards,
Jagadish -
Concatinating a field from several records into a single string
Using Crystal Reports 11
I have a table of EMS/Fire runs, with a related table of fire trucks that respond on each run. My report is grouped by EMS/Fire run, and then the details section shows each truck, something like this....
Run #1 | 123 E Main St | Structure Fire
E123
E124
E125
L123
L342
R153
Run #2 | 455 S High St | Fire Alarm
E322
E233
L122
What I would like to do is hide the details section, and instead in the footer section of each group, have a "text field" that combines all of the trucks into 1 line, something like this...
Run #1 | 123... | Stru... | E123, E124, E125, L123...
Run #2 | 455... | Fir... | E322, E233, L122
Basically the logic would be:
For Each RecordInThisGroup
If Maximum(TruckNumberField) = TruckNumber Field Then
TruckNumberField
Else
TruckNumberField & ", "
Next RecordInThisGroup
Is there a way to loop through all the records in the group?
Thanks for any insight!
JasonHi Jason,
This can't be done in the Detail section but we can do it in the Group Footer. Seeing as you already are grouping on the EMS/Filre run this is good. We can use a running total to do this.
1) Create a formula and drop it into the Group Header. This will reinitialize the running total for each group:
WhilePrintingRecords;
StringVar Run := "";
You can suppress this formula so you don't see it when you run the report
2) Now create another formula that will go into the Detail section. This is the formula that will build the string:
WhilePrintingRecords;
StringVar Run;
Run := Run & & ", " & {table.TRUCK};
You can hide the detail section or format this formula to be suppressed so you don't see it.
3) The last formula goes into the GroupFooter section and will display the string:
WhilePrintingRecords;
StringVar Run;
Good luck,
Brian -
Concatinating two fields into one..
Hi all,
I have a query wherin i need to concatinate two fields and display it into one.
Query: We have two fields one of subtype 0001 and d other of subtype 0014. I have to display these two fields together.
The fields are Pernr Wtf08 ZAllergy AEDTM Zlastillness Exdat.
Where Pernr wtf08 and zallergy Aedtm are in subtype 0001 and the pernr Aedtm Zlastillness Exdat are from the subtype 0014. I took a workarea of the type a method containing all the above fields. And now i want to show all the fields together in one field while displaying.
Can u please help me with any pointers or any sample code.
Thanks,
AnitaYou can create a new Data field with character 255 or more.
Then you use the CONCATENATE Function to combine all the field you wanted to.
e.g.
CONCATENATE Pernr wtf08 and zallergy Aedtm INTO L_display SEPARATED BY SPACE.
L_display is the field to concatinate two fields. -
How To Supress Few Characters From a ZTable field.
Hi,
I have a Field called 123-abc in my Ztable. That is driven by concatinating 2 fields from standard SAP Table.
Now I want to Compare the Ztable-field with one of the field from Standard SAP field like 123.
How to do that??Do something like this -;)
REPORT ZDUMMY_ATG.
DATA: T1 TYPE STRING,
T2 TYPE STRING,
POS TYPE I,
LONG TYPE I.
T1 = '123-ABC'.
T2 = '123'.
TRANSLATE T1 TO UPPER CASE.
SEARCH T1 FOR '-'.
POS = SY-FDPOS + 1.
LONG = STRLEN( T1 ).
LONG = LONG - POS.
IF T1+0(LONG) EQ T2.
WRITE 'The Same...'.
ELSE.
WRITE 'Not the Same...'.
ENDIF.
Greetings,
Blag.
Maybe you are looking for
-
What is wrong with my Gamecenter?
Recently I logged out of my Gamecenter so that I could let a friend play a game called Clash of Clans on my phone. Today I tried to log back in, I did so, but all my friends and games are now gone. The weirdest part is that when I checked my brothers
-
An error occurred while ready from devices
I am using windows vista and trying to sync up to my pc. When I try to sync up, I get the message that an error occurred while reading from device and an error occurred while writing to the device. I have two iPods. One iPod had a restore done to it.
-
as you can see none of them shows up as powers but when i transfer it into my pc it works perfectly
-
I cannot create an empty SOA project in JDeveloper 11.1.1.6
I can only create a SOA application. I know that this option was available in the previous versions. BTW, I have added the SOA Composite Editor update without any issues. Thanks
-
Storing music on my iPhone by album name
All of my iTunes albums are stored alphabetically on my mac but are by album title on my iPhone 4s. How can I get them both to look the same?