How to create New columns for the Internal Table Dynamically?
HI Guys,
In my logic i have to create new columns depending on the logic which i am executing.
My requirement is .I have to display o/p like this
Material || Year || Period || Mix ratio || Vendor ||Mix Ratio || Vendor || Mix Ratio Vendor || Mix ratio || Vendor || Mix ratio.............................from table's CKMLMV003 and CKMLMV001.Her i have to display the o/p in the above format and i have to display Vendor and Mix Ratio for 5 columns irrespective of data .If i have more than 5 columns for any record then i have to create a New columns dynamically for Vendor and Mix ratio.If anybody want my code i can Submit But plz tell with example how to do?
<b>The O/P must be finally shown in ALV Grid</b>
Thanks,
Gopi
You must create the entire internal table dynamically, you can not add columns to a statically define internal table. Here is an example of creating a dynamic internal table.
Creation of internal table dynamically based on the Date Range entered
Regards,
Rich Heilman
Similar Messages
-
How to Create New Application for iPhone
Hi,
Can anyone guide me how to create New Applications for the iPhone.
Regards,
Mustafa Ali QizilbashIf you think Apple's is making a profit off the $99 it collects for the iPhone Developer Program membership, you're badly underestimating how much it costs to run the program.
-
How to create new or delete the existing row in the grid....
hi my friends...
i am developing report using Reuse_alv_grid_display...
my requirement is... At runtime
1. i may create new row on the grid (empty row inwhich i may enter the data).
2. i may delete a existing row in the grid
3. i may edit the existing data...
then i have to trace the modification in the grid in one internal table...
how can i get into this.....
note:
i have some idea to edit the existing record in the grid and trace those modification,
but i don't know abt how to create new or delete the existing row....
can you give me some idea...Hi deva,
write a class which implemets these methods
CLASS lcl_event_receiver DEFINITION.
PUBLIC SECTION.
METHODS:
To handle the toolbar on alv
handle_toolbar
FOR EVENT toolbar OF cl_gui_alv_grid
IMPORTING e_object e_interactive,
To handle the buttons on the alv grid
handle_user_command
FOR EVENT user_command OF cl_gui_alv_grid
IMPORTING e_ucomm.
endclass.
Now Implement these methods.
CLASS lcl_event_receiver IMPLEMENTATION.
To handle the toolbar on alv
METHOD handle_toolbar.
DATA ls_toolbar TYPE stb_button.
CLEAR gs_toolbar.
MOVE 3 TO gs_toolbar-butn_type.
APPEND gs_toolbar TO e_object->mt_toolbar.
CLEAR gs_toolbar.
PERFORM icon_create USING 'ICON_INSERT_ROW' gs_toolbar-icon.
MOVE text-010 TO gs_toolbar-function.
MOVE text-012 TO gs_toolbar-quickinfo.
MOVE ' ' TO gs_toolbar-disabled.
APPEND gs_toolbar TO e_object->mt_toolbar.
CLEAR gs_toolbar.
PERFORM icon_create USING 'ICON_DELETE_ROW' gs_toolbar-icon.
MOVE text-011 TO gs_toolbar-function.
MOVE text-013 TO gs_toolbar-quickinfo.
MOVE ' ' TO gs_toolbar-disabled.
APPEND gs_toolbar TO e_object->mt_toolbar.
ENDMETHOD.
METHOD handle_user_command.
In this form, check the function code(e_ucomm has the function code), based on that do the required action.
as i said yesterday(i.e for appending a row, deleting a row, modifying a row)
PERFORM user_command USING e_ucomm.
ENDMETHOD
endclass.
Before calling the alv method, create a object of this class.
DATA :
gref_event_receiver TYPE REF TO lcl_event_receiver,
gv_tables_alv TYPE REF TO cl_gui_alv_grid.
CREATE OBJECT gref_event_receiver.
SET HANDLER gref_event_receiver->handle_user_command
FOR gv_tables_alv.
SET HANDLER gref_event_receiver->handle_toolbar
FOR gv_tables_alv.
check this program for event handling, it is the similar way
demo_abap_objects_events
Hope u understood this.
Regards,
Prasant
reward if helpful -
How to create new scope for SharePoint calendar?
How to create new scope for SharePoint calendar?
I have a calendar list to which I want to create following scopes-
Annual View
Half Year 1 (Jan-June)
Half Year 2 (Jul-Dec)
Quarter 1 (Jan-Mar)
Quarter 2 (Apr-Jun)
Quarter 3 (Jul-Sep)
Quarter 4 (Oct-Dec)
How this can be created. Any help appriciated. Thanks.Hi Pratima,
Can you please see below link and code snippet for how to
format date in gridview.
http://www.aspdotnet-suresh.com/2011/05/how-to-set-date-format-in-gridview.html
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Gridvew Date format</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:GridView runat="server" ID="gvdetails" DataSourceID="dsdetails" AllowPaging="true" AllowSorting="true" AutoGenerateColumns="false">
<RowStyle BackColor="#EFF3FB" />
<FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
<HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<AlternatingRowStyle BackColor="White" />
<Columns>
<asp:BoundField DataField="Date1" HeaderText="Date1" HtmlEncode="false" DataFormatString="{0:s}" />
<asp:BoundField DataField="Date2" HeaderText="Date2" HtmlEncode="false" DataFormatString="{0:D}" />
<asp:BoundField DataField="Date3" HeaderText="Date3" HtmlEncode="false" DataFormatString="{0:m}" />
<asp:BoundField DataField="Date4" HeaderText="Date4" HtmlEncode="false" DataFormatString="{0:d}" />
<asp:BoundField DataField="Total" HeaderText="Total" HtmlEncode="false" DataFormatString="{0:C2}" />
</Columns>
</asp:GridView>
<asp:SqlDataSource ID="dsdetails" runat="server" SelectCommand="select * from DateFormat" ConnectionString="<%$ConnectionStrings:dbconnection %>"></asp:SqlDataSource>
</div>
</form>
</body>
</html>
Hope this will help you.
Regards
Soni K -
How to create new structure for SOP?
How to create new structure for SOP? and transfer data for long term planning?
hi dear
For SOP there are two types
1. Standard SOP : this the standard SOP configured by SAP consider the Level by Level planning and planning done for product group .
2. Flexible planning SOP: this option is given, so that Rough planning/SOP planning can be done as per the client requirement.e.g planning structure can be sales orgn., distribution channel, division, plant, material
For configuring the flexible planning SOP follow steps
1. Define info structure in IMG
where u define the characteristic and Key field
2. Set parameters for info structures and key figures
Sales & Operations Planning >Master Data>Set parameters for info structures and key figures
where u define Planning method
Consistent planning
Level-by-level planning
Delta planning
and aggregation type
1. Average calculated
2. Total created
3. No aggregation
3. create Planning type with reference to info structure
Regards
Suresh -
How to define new colors for the form?(Finish)
Hello! Everyone!
I want to define new colors for the new form.
But I don't find where I can define it.
How to define new color for the form?
Thanks in advance!You have to set the Canvas color or as I said earlier you need to use one of the available color schemas on the OAS or Builder runtime.
If you want to use user defined colors in the builder, then you need to create a new color palette and use it.
I personally haven't tried it, but there is a section in the online help that describes how to do this.
Tony -
How to find the number of columns in an internal table DYNAMICALLY ?
Hi,
How to find the number of columns in an internal table DYNAMICALLY ?
Thanks and Regards,
saleem.Hi,
you can find the number of columns and their order using
the <b>'REUSE_ALV_FIELDCATALOG_MERGE'</b>
call function 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = sy-repid
I_INTERNAL_TABNAME = 'ITAB'
I_INCLNAME = sy-repid
changing
ct_fieldcat = IT_FIELDCAT
EXCEPTIONS
INCONSISTENT_INTERFACE = 1
PROGRAM_ERROR = 2
OTHERS = 3
if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif
now describe your fieldcat . and find no of columns.
and their order also..
regards
vijay -
How to create a validation for the project coding mask
Hi,
Would just like to ask how to create a validation for the project coding mask wherein the WBS elements hierarchy will be checked against the template saved. For example,
project coding mask is XXXX-XXXXX-XX-X-X-X-00-X
mother WBS should be XXXX-XXXXX-X and lower level WBS would be XXXX-XXXXX-XX.
The validation should not allow a mother WBS to be XXXX-XXXXX-XX.
How can we go about this?Hi Jacquiline Bersamin,
You can use validation with the combination of the level and the coding mask.
In the validation:
Pre requisite: WBS level = 1
Validation: Prps-posid = prps-posid :1-12:
Message : Error
If required you can give the parameters for your detail error message.
Please let me know if this does not work.
Thanks
Regards
Srinivasan Desingh -
How to create a password for the pdf file
In Adore Acrobat XI, how to create a password for the file? The help states going to Tools Menu and clicking on Protection tab - but there is no such option. In the file - properties - security screen, it shows the security details but does not allow to edit it.
I think you may be mixing up two different products: Adobe Reader (free), and Acrobat ($$).
-
HOW TO CREATE SEVERAL folder for the generation and READING FILE
HOW TO CREATE SEVERAL folder for the generation and READING FILE WITH THE COMMAND utl_File.
please give an example to create 3 folders or directories ...
I appreciate your attention ...
Reynel Martinez SalazarI hope this link help you.
[http://www.adp-gmbh.ch/ora/sql/create_directory.html]
create or replace directory exp_dir as '/tmp';
grant read, write on directory exp_dir to eygle;
SQL> create or replace directory UTL_FILE_DIR as '/opt/oracle/utl_file';
Directory created.
SQL> declare
2 fhandle utl_file.file_type;
3 begin
4 fhandle := utl_file.fopen('UTL_FILE_DIR', 'example.txt', 'w');
5 utl_file.put_line(fhandle , 'eygle test write one');
6 utl_file.put_line(fhandle , 'eygle test write two');
7 utl_file.fclose(fhandle);
8 end;
9 /
PL/SQL procedure successfully completed.
SQL> !
[oracle@jumper 9.2.0]$ more /opt/oracle/utl_file/example.txt
eygle test write one
eygle test write two
[oracle@jumper 9.2.0]$
SQL> declare
2 fhandle utl_file.file_type;
3 fp_buffer varchar2(4000);
4 begin
5 fhandle := utl_file.fopen ('UTL_FILE_DIR','example.txt', 'R');
6
7 utl_file.get_line (fhandle , fp_buffer );
8 dbms_output.put_line(fp_buffer );
9 utl_file.get_line (fhandle , fp_buffer );
10 dbms_output.put_line(fp_buffer );
11 utl_file.fclose(fhandle);
12 end;
13 /
eygle test write one
eygle test write two
PL/SQL procedure successfully completed.
SQL> select * from dba_directories;
OWNER DIRECTORY_NAME DIRECTORY_PATH
SYS UTL_FILE_DIR /opt/oracle/utl_file
SYS BDUMP_DIR /opt/oracle/admin/conner/bdump
SYS EXP_DIR /opt/oracle/utl_file
SQL> drop directory exp_dir;
Directory dropped
SQL> select * from dba_directories;
OWNER DIRECTORY_NAME DIRECTORY_PATH
SYS UTL_FILE_DIR /opt/oracle/utl_file
SYS BDUMP_DIR /opt/oracle/admin/conner/bdumpRegards salim.
Edited by: Salim Chelabi on Apr 4, 2009 4:33 PM -
How to create new version for material
Hi expert,
Can anyone please guide me step by step on how to create new version for material and vendor? Please also mention transaction and details step by step.
ThanksHI,
Do you mean to have version management for purchasing documents?.
Best Regards,
Arminda Jack -
Need to add 2 new columns to the existing table control of C223 transaction
Hi ABAP Gurus,
I have to do a screen enhancement for transaction C223.
Below is the requirement:
need to add 2 new columns to the existing table control of C223 transaction.
there is no customer exits, screen exit or user exit present for this transaction C223, i have found one enhancement spot for this transaction.
i dont have any idea how to do this in standard transaction C223, the table control in C223 saves the data to MKAL table and the table control uses the structure MKAL_EXPAND in the screen program.
i have created an append structure for the 2 fields to the standard table MKAL.
Can anyone please suggest me how this can be done in standard screen C223, will the enhancement spot can be used to do this....
please sugest...
Thanks & RegardsHi Santosh,
Thanks for the reply. I have looked into this Enhancement Spot CPFX_SCREEN_SET , inside this there is only one method INPUT_DISABLED having below parameters
IM_MKAL Importing Type MKAL Production Version
EX_MSGID Exporting Type SY-MSGID Messages, Message
EX_MSGTY Exporting Type SY-MSGTY Messages, Message
EX_MSGNO Exporting Type SY-MSGNO Messages, Message
EX_MSGV1 Exporting Type SY-MSGV1 Messages, Message
EX_MSGV2 Exporting Type SY-MSGV2 Messages, Message
EX_MSGV3 Exporting Type SY-MSGV3 Messages, Message
EX_MSGV4 Exporting Type SY-MSGV4 Messages, Message
EX_INPUT_DISABLE Exporting Type CHAR1 Display Only if X Was Set
the BADI definition present here is a SAP internal so we cant implement the BADI , but we can created a enhancement spot implementation for this. as per my understanding on this the enhancement spot is only for making the table control fields display / change . i dont think this can be used to add two new coloumns to C223 table control.
I am not sure thats why seeking your help/valuable sugestion on this.
Please provide your sugestion on this , so that i can come to conclusion on this issue.
Thanks & Regards
Siddhartha Mishra -
How to create transaction code for a Z-table
How to create transaction code for a Z-table?
Se93 --> then which radio button to be selected? and what is the program nam e to be givenHi Sam,
<b>Procedure to create a TCODE for ZTABLE:</b>
Create a table maintainance/View for the Z* Table.
Once you create the view goto SE93>Select Parameter transaction and give the short desc.>
Give the transaction as SM30(Skip the first screen-optional)>Check all check boxes under GUI support>In the default values(grid)section first row give the VIEWNAME as you created initially and the second row UPDATE as X.
<u><i>Se93 --> then which radio button to be selected</i></u>
Select the parameter transaction as a radio button.
<u><i>what is the program nam e to be given</i></u>
no need to give any program name. Instead you have to give the transaction code name as SM30.
Pls mark the helpful answers.
Thanks
Eswar -
How to insert select columns from one internal table to another
Hi,
How to insert select columns from one internal table to another based on condition as we do from a standart table to internal table.
regards,
SriramHi,
If your question is for copying data from 1 int table to other ;
we can use
APPEND LINES OF it_1 TO it_2.
or if they have different columns then:
loop at it_1 into wa_it1.
move wa_it1-data to wa_it2-d1.
apped wa_it2 to it_2.
clear wa_it2.
endloop.
thnxz -
How to submit a report ,Passing the internal tables from parent report
How to submit a report ,Passing the internal tables from the parent report ?
The SUBMIT statement executes a report from within a report. i.e. you could have a drill-down which
calls another report. Can only execute reports of type '1'.
*Code used to execute a report
SUBMIT Zreport.
*Code used to populate 'select-options' & execute report
DATA: seltab type table of rsparams,
seltab_wa like line of seltab.
seltab_wa-selname = 'PNPPERNR'.
seltab_wa-sign = 'I'.
seltab_wa-option = 'EQ'.
load each personnel number accessed from the structure into
parameters to be used in the report
loop at pnppernr.
seltab_wa-low = pnppernr-low.
append seltab_wa to seltab.
endloop.
SUBMIT zreport with selection-table seltab
via selection-screen.
*Code used to populate 'parameters' & execute report
SUBMIT zreport with p_param1 = 'value'
with p_param2 = 'value'.
Other additions for SUBMIT
*Submit report and return to current program afterwards
SUBMIT zreport AND RETURN.
*Submit report via its own selection screen
SUBMIT zreport VIA SELECTION-SCREEN.
*Submit report using selection screen variant
SUBMIT zreport USING SELECTION-SET 'VARIANT1'.
*Submit report but export resultant list to memory, rather than
*it being displayed on screen
SUBMIT zreport EXPORTING LIST TO MEMORY.
Once report has finished and control has returned to calling
program, use function modules LIST_FROM_MEMORY, WRITE_LIST and
DISPLAY_LIST to retrieve and display report.
*Example Code (Retrieving list from memory)
DATA BEGIN OF itab_list OCCURS 0.
INCLUDE STRUCTURE abaplist.
DATA END OF itab_list.
DATA: BEGIN OF vlist OCCURS 0,
filler1(01) TYPE c,
field1(06) TYPE c,
filler(08) TYPE c,
field2(10) TYPE c,
filler3(01) TYPE c,
field3(10) TYPE c,
filler4(01) TYPE c,
field4(3) TYPE c,
filler5(02) TYPE c,
field5(15) TYPE c,
filler6(02) TYPE c,
field6(30) TYPE c,
filler7(43) TYPE c,
field7(10) TYPE c,
END OF vlist.
SUBMIT zreport EXPORTING LIST TO MEMORY.
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
listobject = itab_list
EXCEPTIONS
not_found = 4
OTHERS = 8.
CALL FUNCTION 'LIST_TO_ASCI'
EXPORTING
list_index = -1
TABLES
listasci = vlist
listobject = itab_list
EXCEPTIONS
empty_list = 1
list_index_invalid = 2
OTHERS = 3.
IF sy-subrc NE '0'.
WRITE:/ 'LIST_TO_ASCI error !! ', sy-subrc.
ENDIF.
Submit report as job
*Submit report as job(i.e. in background)
data: jobname like tbtcjob-jobname value
' TRANSFER TRANSLATION'.
data: jobcount like tbtcjob-jobcount,
host like msxxlist-host.
data: begin of starttime.
include structure tbtcstrt.
data: end of starttime.
data: starttimeimmediate like btch0000-char1.
Job open
call function 'JOB_OPEN'
exporting
delanfrep = ' '
jobgroup = ' '
jobname = jobname
sdlstrtdt = sy-datum
sdlstrttm = sy-uzeit
importing
jobcount = jobcount
exceptions
cant_create_job = 01
invalid_job_data = 02
jobname_missing = 03.
if sy-subrc ne 0.
"error processing
endif.
Insert process into job
SUBMIT zreport and return
with p_param1 = 'value'
with p_param2 = 'value'
user sy-uname
via job jobname
number jobcount.
if sy-subrc > 0.
"error processing
endif.
Close job
starttime-sdlstrtdt = sy-datum + 1.
starttime-sdlstrttm = '220000'.
call function 'JOB_CLOSE'
exporting
event_id = starttime-eventid
event_param = starttime-eventparm
event_periodic = starttime-periodic
jobcount = jobcount
jobname = jobname
laststrtdt = starttime-laststrtdt
laststrttm = starttime-laststrttm
prddays = 1
prdhours = 0
prdmins = 0
prdmonths = 0
prdweeks = 0
sdlstrtdt = starttime-sdlstrtdt
sdlstrttm = starttime-sdlstrttm
strtimmed = starttimeimmediate
targetsystem = host
exceptions
cant_start_immediate = 01
invalid_startdate = 02
jobname_missing = 03
job_close_failed = 04
job_nosteps = 05
job_notex = 06
lock_failed = 07
others = 99.
if sy-subrc eq 0.
"error processing
endif.
Maybe you are looking for
-
Message Inbox: Long time to receive messages
Hi All, My client is on 8.8 PL15. They complain that it takes a very long time to receive Approvals in th Messages/Alert Overview window, although the Update Messages in General Settings > Services is set to be 1 minute. They complain that they need
-
Time Machine Taking a Long Time to Index
Hi everyone. I first noticed this today. My Time Machine is taking a long time to index. It's stuck on "Waiting for index to be ready (100)" for about 10 minutes at least, it seems. I did notice earlier today that it had to delete old backups to m
-
Ristretto or maybe generic mime.types issue: case of file extension?
Good day. Ristretto (the XFCE image viewer) wouldn't recognize the .TIF files I copied over from a Windows partition until I renamed them to .tif. Lowercase .tiff and .tif are indeed the only two file extensions that are mentioned for image/tiff in /
-
I am trying to download creative cloud, but it says "installer failed to initialize". What is this and how do I fix it?
-
Can you use iCloud to save iPhotos to the cloud? When I sign in to iCloud, I just see a few basic apps, no iPhotos.