How to use ALV for Hierarchical Lists
Hi All,
I am satish, trying to get the hierarchical list using REUSE_ALV_HIERSEQ_LIST_DISPLAY function module. But it is going to dump. I couldn't find out where is mistake. So please any one help me to do this.
This is the code.
tables: vbak,vbap.
type-pools slis.
DATA: thead like vbak OCCURS 0,
titem like vbap occurs 0,
G_REPID LIKE SY-REPID,
ls_fieldcat TYPE slis_fieldcat_alv.
select * from vbak into table thead up to 5 rows.
select * from vbap into table titem up to 5 rows.
g_repid = sy-repid.
CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = 'I'
I_CALLBACK_PROGRAM = g_repid
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
IS_LAYOUT =
IT_FIELDCAT = ls_fieldcat
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
I_DEFAULT = 'X'
I_SAVE = 'A'
IS_VARIANT =
IT_EVENTS =
IT_EVENT_EXIT =
I_TABNAME_HEADER = 'VBAK'
I_TABNAME_ITEM = 'VBAP'
I_STRUCTURE_NAME_HEADER = 'vbak'
I_STRUCTURE_NAME_ITEM = 'vbap'
IS_KEYINFO =
IS_PRINT =
IS_REPREP_ID =
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB_HEADER = Thead
T_OUTTAB_ITEM = titem.
Thanks & Regards,
Satish.
HI Satish,
Check this code.
report zxxx_alvexer4 message-id zz .
*& TABLES DECLARATION *
tables: vbak, vbap.
*& TYPE POOLS DECLARATION *
type-pools: slis.
DATA DECLARATIONS *
data: v_flag type c. "Flag to display the header
data: v_repid type sy-repid.
*& INTERNAL TABLE DECLARATION *
data: begin of it_vbak occurs 0,
vbeln like vbak-vbeln,
audat like vbak-audat,
auart like vbak-auart,
netwr like vbak-netwr,
expand(1),
end of it_vbak.
data: begin of it_vbap occurs 0,
vbeln like vbap-vbeln,
posnr like vbap-posnr,
matnr like vbap-matnr,
pstyv like vbap-pstyv,
charg like vbap-charg,
end of it_vbap.
data: it_fldcat type slis_t_fieldcat_alv,
it_fldcat1 type slis_t_fieldcat_alv,
*events
it_events type slis_t_event with header line,
v_call type c,
x_user type slis_exit_by_user,
it_variant like disvariant occurs 0 with header line,
x_keyinfo type slis_keyinfo_alv,
*layout
x_layout type slis_layout_alv,
*sort
it_sort type slis_t_sortinfo_alv,
wa_sort like line of it_sort,
x_cat type slis_fieldcat_alv,
v_tabix like sy-tabix.
Selection screen Declaration
*--BLOCK1
selection-screen begin of block b1 with frame title text-001.
select-options: s_vbeln for vbak-vbeln,
s_auart for vbak-auart.
selection-screen end of block b1.
AT SELECTION-SCREEN *
*- Validations
at selection-screen.
perform validate_screen.
START OF SELECTION *
start-of-selection.
*- To get data from VBAK
perform get_data.
*to get data from VBAP
perform get_data_vbap.
perform prepare_alv.
END OF SELECTION *
end-of-selection.
perform display_report.
*& Form VALIDATE_SCREEN
text
--> p1 text
<-- p2 text
form validate_screen .
data: lv_vbeln like vbak-vbeln,
lv_auart like vbak-auart.
if not s_vbeln[] is initial.
select vbeln
into lv_vbeln
from vbak
where vbeln in s_vbeln.
endselect.
if sy-subrc <> 0.
message e000 with 'INVALID SALES DOC'(002).
endif.
endif.
if not s_auart[] is initial.
select auart
into lv_auart
from vbak
where auart in s_auart.
endselect.
if sy-subrc <> 0.
message e000 with 'INVALID SALES DOC TYPE'(003).
endif.
endif.
endform. " VALIDATE_SCREEN
*& Form GET_DATA
text
--> p1 text
<-- p2 text
form get_data .
select vbeln
audat
auart
netwr
from vbak
into table it_vbak
where vbeln in s_vbeln
and auart in s_auart.
if sy-subrc = 0.
sort it_vbak by vbeln.
endif.
endform. " GET_DATA
*& Form GET_DATA_VBAP
text
--> p1 text
<-- p2 text
form get_data_vbap .
select vbeln
posnr
matnr
pstyv
charg
into table it_vbap
from vbap
for all entries in it_vbak
where vbeln = it_vbak-vbeln.
if sy-subrc = 0.
sort it_vbap by vbeln posnr.
endif.
endform. " GET_DATA_VBAP
*& Form prepare_alv
text
--> p1 text
<-- p2 text
form prepare_alv .
Prepare field catalog .
perform prepare_catalog.
Modify catalog
perform change_attr_of_catalog.
Modify Layout
perform modify_layout.
Sort Catalog
perform sort_catalog.
endform. " prepare_alv
*& Form prepare_catalog
text
--> p1 text
<-- p2 text
form prepare_catalog .
call function 'REUSE_ALV_FIELDCATALOG_MERGE'
exporting
i_program_name = sy-repid
i_internal_tabname = 'IT_VBAK'
i_inclname = sy-repid
changing
ct_fieldcat = it_fldcat1[]
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.
append lines of it_fldcat1 to it_fldcat.
clear: it_fldcat1[].
call function 'REUSE_ALV_FIELDCATALOG_MERGE'
exporting
i_program_name = sy-repid
i_internal_tabname = 'IT_VBAP'
i_inclname = sy-repid
changing
ct_fieldcat = it_fldcat1[]
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.
append lines of it_fldcat1 to it_fldcat.
endform. " prepare_catalog
*& Form change_attr_of_catalog
text
--> p1 text
<-- p2 text
form change_attr_of_catalog .
loop at it_fldcat into x_cat.
v_tabix = sy-tabix.
case x_cat-fieldname.
when 'EXPAND'.
if x_cat-tabname = 'IT_VBAK'.
x_cat-no_out = 'X'.
endif.
when 'VBELN'.
if x_cat-tabname = 'IT_VBAK'.
x_cat-no_out = 'X'.
endif.
when 'VBELN'.
if x_cat-tabname = 'IT_VBAK'.
x_cat-col_pos = '1'.
x_cat-seltext_m = 'SALES DOC'.
x_cat-seltext_l = 'SALES DOC'.
x_cat-seltext_s = 'SALES DOC'.
x_cat-outputlen = '10'.
endif.
when 'AUDAT'.
if x_cat-tabname = 'IT_VBAK'.
x_cat-col_pos = '2'.
x_cat-seltext_m = 'DOC DATE'.
x_cat-seltext_l = 'DOC DATE'.
x_cat-seltext_s = 'DOC DATE'.
x_cat-outputlen = '8'.
endif.
when 'AUART'.
if x_cat-tabname = 'IT_VBAK'.
x_cat-col_pos = '3'.
x_cat-seltext_m = 'ORDER REASON'.
x_cat-seltext_l = 'ORDER REASON'.
x_cat-seltext_s = 'ORDER REASON'.
x_cat-outputlen = '5'.
endif.
when 'NETWR'.
if x_cat-tabname = 'IT_VBAK'.
x_cat-col_pos = '4'.
x_cat-seltext_m = 'NET PRICE'.
x_cat-seltext_l = 'NET PRICE'.
x_cat-seltext_s = 'NET PRICE'.
x_cat-outputlen = '15'.
endif.
endcase.
modify it_fldcat from x_cat.
clear x_cat.
endloop.
endform. " change_attr_of_catalog
*& Form modify_layout
text
--> p1 text
<-- p2 text
form modify_layout .
x_layout-default_item = 'X'.
x_layout-zebra = 'X'.
x_layout-expand_fieldname = 'EXPAND'.
endform. " modify_layout
*& Form sort_catalog
text
--> p1 text
<-- p2 text
form sort_catalog .
clear wa_sort.
wa_sort-spos = '01'.
wa_sort-fieldname = 'VBELN' .
wa_sort-tabname = 'IT_VBAP'.
wa_sort-up = 'X'.
append wa_sort to it_sort.
clear wa_sort.
wa_sort-spos = '02'.
wa_sort-fieldname = 'POSNR' .
wa_sort-tabname = 'IT_VBAP'.
wa_sort-up = 'X'.
append wa_sort to it_sort.
endform. " sort_catalog
*& Form DISPLAY_REPORT
text
--> p1 text
<-- p2 text
form display_report .
it_variant-report = sy-repid.
sort it_vbak by vbeln.
sort it_vbap by vbeln posnr.
call function 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
exporting
i_callback_program = sy-repid
is_layout = x_layout
it_fieldcat = it_fldcat[]
it_sort = it_sort
is_variant = it_variant
it_events = it_events[]
i_tabname_header = 'IT_VBAK'
i_tabname_item = 'IT_VBAP'
is_keyinfo = x_keyinfo
importing
e_exit_caused_by_caller = v_call
es_exit_caused_by_user = x_user
tables
t_outtab_header = it_vbak
t_outtab_item = it_vbap
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.
Regards,
Plz reward points and close the thread,
Laxmi.
Similar Messages
-
How to assign ALV for parent node and child node that uses supply method.?
HI Dear friends,
I need to display header details ( VBAK ) and Item details ( VBAP ). I have created two node like HEADER_NODE inside this i have created ITEM_NODE for this item node i use supply function 'GET_ITEMS' any way it is working only when crete two separate table and binding but when i come to work with ALV i am totally confused .. i have created two 'View Controller UI Elements' when i try to map HEADER_NODE it mapped properly but for ITEM_NODE it shows mapping already defined. return status message as 'Action Cancelled' . In result both ViewContainer shows only HEADER_NODE data only.
How to achive ALV for Parent, child node that uses supply function ? ?
Thank youDelete Mapping is not enabled, that means there is no mapping done yet.
I just tried what you are saying and the application works and i am able to map the header table and item table and also again i could map the tables any number of times.. i didn't get any such message, sorry i couldn't recreate the scenario. might be there is something wrong in the context.
i just did it like this.
Please also move this to Web DynPro Discussion, Hope that would be helpful.
Message was edited by: Syed Ghulam Ali -
hi all
thanks in advance
how to use alv in programm please can any one send me simple example of alv
thanksHi,
Refer this code. If u find it useful, reward points.
TYPE-POOLS: slis.
Data Declaration
DATA: wa_layout TYPE slis_layout_alv, "Layout structure
it_fieldcatalog TYPE slis_t_fieldcat_alv, " Fieldcatlog IT
wa_fieldcatalog TYPE slis_fieldcat_alv, " Fieldcatlog WA
lt_event TYPE slis_t_event, "for capturing page events
ls_event TYPE slis_alv_event. " WA for Page Events
Data: l_syrep type sy-repid,
l_tcode type sy-tcode.
*& I N I T I A L I Z A T I O N *
INITIALIZATION .
l_syrep = sy-repid.
l_tcode = sy-tcode.
*& AT SELECTION-SCREEN *
AT SELECTION-SCREEN.
*& START-OF-SELECTION *
START-OF-SELECTION.
*& END-OF-SELECTION *
END-OF-SELECTION.
PERFORM build_layout.
PERFORM build_catlog.
PERFORM build_events.
*& AT LINE-SELECTION *
AT LINE-SELECTION.
*& Form build_layout
Building the Layout
FORM build_layout .
wa_layout-ZEBRA = 'X'.
wa_layout-NO_VLINE = 'X'.
wa_layout-NO_HLINE = 'X'.
wa_layout-CELL_MERGE = 'X'.
wa_layout-EDIT = 'X'.
wa_layout-WINDOW_TITLEBAR = ''.
wa_layout-NO_ULINE_HS = 'X'.
wa_layout-LIGHTS_FIELDNAME = ''.
wa_layout-LIGHTS_TABNAME = ''.
wa_layout-LIGHTS_ROLLNAME = ''.
wa_layout-LIGHTS_CONDENSE = 'X'.
wa_layout-NO_TOTALLINE = 'X'.
wa_layout-NO_SUBTOTALS = 'X'.
wa_layout-TOTALS_BEFORE_ITEMS = 'X'.
wa_layout-TOTALS_ONLY = 'X'.
wa_layout-TOTALS_TEXT = ''.
wa_layout-SUBTOTALS_TEXT = ''.
wa_layout-BOX_FIELDNAME = ''.
wa_layout-BOX_TABNAME = ''.
wa_layout-BOX_ROLLNAME = ''.
wa_layout-CONFIRMATION_PROMPT = 'X'.
wa_layout-HEADER_TEXT = ''.
ENDFORM. " build_layout
*& Form build_catlog
Building the Field Catlog
FORM build_catlog .
wa_fieldcatalog-ROW_POS = 0.
wa_fieldcatalog-COL_POS = 0.
wa_fieldcatalog-FIELDNAME = ''.
wa_fieldcatalog-TABNAME = ''.
wa_fieldcatalog-CHECKBOX = 'X'.
wa_fieldcatalog-DO_SUM = 'X'.
wa_fieldcatalog-OUTPUTLEN = ''.
wa_fieldcatalog-wa_fieldcatalog-OFFSET = ''.
wa_fieldcatalog-SELTEXT_L = ''.
wa_fieldcatalog-SELTEXT_M =''.
wa_fieldcatalog-SELTEXT_S =''.
wa_fieldcatalog-REF_FIELDNAME =''.
wa_fieldcatalog-REF_TABNAME = ''.
wa_fieldcatalog-NO_SUM ='X'.
wa_fieldcatalog-EDIT ='X'.
wa_fieldcatalog-HOTSPOT = 'X'.
APPEND wa_fieldcatalog TO it_fieldcatalog.
CLEAR wa_fieldcatalog.
ENDFORM. " build_catlog
*& Form build_events
Building the Events
FORM build_events .
Get all possible events
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 0
IMPORTING
et_events = lt_event
EXCEPTIONS
list_type_wrong = 1
OTHERS = 2.
IF sy-subrc <> 0.
ENDIF.
Specify events used in selection screen
READ TABLE lt_event WITH KEY name = slis_ev_top_of_page
INTO ls_event.
IF sy-subrc = 0.
ls_event-form = 'TOP_OF_PAGE'.
MODIFY lt_event FROM ls_event INDEX sy-tabix.
CLEAR ls_event.
ENDIF.
READ TABLE lt_event WITH KEY name = slis_ev_end_of_list
INTO ls_event.
IF sy-subrc = 0.
ls_event-form = 'END_OF_LIST'.
MODIFY lt_event FROM ls_event INDEX sy-tabix.
CLEAR ls_event.
ENDIF.
ENDFORM. " build_events
*& Form TOP_OF_PAGE
To display top of the page
FORM top_of_page .
data: lt_top_of_page type slis_t_listheader,
ls_line type slis_listheader.
clear ls_line.
ls_line-typ = 'H'.
ls_line-info = ''.
append ls_line to lt_top_of_page.
clear ls_line.
ls_line-typ = 'S'.
ls_line-key = ''.
ls_line-info = ''.
append ls_line to lt_top_of_page.
clear ls_line.
ls_line-typ = 'A'.
ls_line-info = ''.
append ls_line to lt_top_of_page.
clear ls_line.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = lt_top_of_page
I_LOGO =
I_END_OF_LIST_GRID =
ENDFORM. " TOP_OF_PAGE
*& Form end-of-list
To display the totals at the end of the list
FORM end_of_list .
ENDFORM. " end-of-list
*& Form set_pf_status
Set the Pf Status
FORM pf_status USING pa_extab TYPE slis_t_extab.
SET PF-STATUS 'ZXXXX'.
ENDFORM. "SET_PF_STATUS
*& Form user_command
To Catch the User Events
-->PA_UCOMM text
-->PA_SELFIELD text
FORM user_command USING pa_ucomm TYPE syucomm
pa_selfield TYPE slis_selfield.
CASE pa_ucomm.
WHEN '&IC1'.
CLEAR gs_output .
READ TABLE gt_output INTO gs_output INDEX pa_selfield-tabindex .
CASE pa_selfield-fieldname .
ENDCASE.
WHEN 'XXX'.
WHEN 'XXX'.
ENDCASE.
ENDFORM. "USER_COMMAND -
How to implement tooltip for the list items for the particular column in sharepoint 2013
Hi,
I had created a list, How to implement tooltip for the list items for the particular column in SharePoint 2013.
Any help will be appreciatedWe can use JavaScript or JQuery to show the tooltips. Refer to the following similar thread.
http://social.technet.microsoft.com/forums/en/sharepointdevelopmentprevious/thread/1dac3ae0-c9ce-419d-b6dd-08dd48284324
http://stackoverflow.com/questions/3366515/small-description-window-on-mouse-hover-on-hyperlink
http://spjsblog.com/2012/02/12/list-view-preview-item-on-hover-sharepoint-2010/ -
How to Use 'uid' for AD Users Without Domain Name For User Log in OAM
How to Use 'uid' for synchronized Active Directory (AD) Users into Oracle Internet Directory (OID) Without Domain Name For User Logins in OIDDAS and OAM
We successfully integrated OAM 11g with EBS R12.1.3 Now all the AD user id's stored in fnd_users table as [email protected]
How can we remove @abc.com
We are using OID 11g and OAM 11g
Found the similar note for OID 10G: How to Use 'uid' for AD Users Without Domain Name For User Logins in OIDDAS and SSO [ID 580480.1]
We are in OID 11g.
Any help on this greatly appreciated.I couldn't find any reference that could be helpful -- Please log a SR and see if this is supported and if the steps are available.
Thanks,
Hussein -
How to use webcam for Yahoo Messenger on MacBook Pro, How to use webcam for Yahoo Messenger on MacBook Pro because it's not working =(
The cheap & easy way is to just drag the app to the Trash.
If you want to get all of the associated files use an app deleting app like the free AppCleaner;
http://www.freemacsoft.net/appcleaner/
Just drag an app and drop it on the AppCleaner icon in the Dock and it will find and present to you all the files it thinks are associated with the app. You can uncheck any that you want to keep and then let AppCleaner Trash the rest. -
How to use i for if condition in a for i in loop?
Hi friends,
I have a question on how to use i for IF condition in a loop, in order to get an efficient programming and results. Here is outlined SQL:
cursor is
select c1,c2,c3 from table1; -- 100 rows returned.
open cursor
loop
fetch c1,c2,c3 into v1,v2,v3;
for i in 1..3 loop
if 'v'||i between 90 and 100 then
v_grade := 'Excellent';
elsif 'v'||i between 80 and 89 then
elsif 'v'||i between 50 and 59 then
end if;
end loop;
close cursor;
This way, I don't need to use a lot of if..then for hard code v1,v2,v3,.... actually I have more v..
But Oracle gave an error of this usage of 'if 'v'||i' or 'v'||to_char(i).
Thanks for any advice in advance!user508774 wrote:
Thanks for comments and advices. But I didn't get your inputs clearly. Are you saying I don't need to use PL/SQL to achieve this?Correct. Ronel and John showed you the basic approaches. SQL is not a mere I/O language for making read and write calls. It is a very capable, flexible and powerful language. One can solve a problem with a few lines of SQL code, that will take 100's of lines of PL/SQL or Java code.
So do not underestimate what can be done in SQL.
v_cmd := 'UPDATE parts_categ_counts SET w1='||v1||', w2='||v2||...||v9||' WHERE seq='||vseq||';
EXECUTE IMMEDIATE v_cmd;This code is also wrong. Besides the fact that there is no need for dynamic SQL, this approach creates a brand new SQL statement each loop iteration.
SQL is source code. It needs to be parsed (compiled). The end result is an executable program that is called a cursor. This cursor needs to be stored in server memory (the SQL Shared Pool in the SGA).
The problem with your code is that it is slow and expensive - it generates lots of unique SQL statements that need CPU for parsing and server memory for storage.
These add up to a very significant performance overhead. That is the wrong approach. The correct approach is the same one that you would use in any other programming language.
Let's say you need to use Java to process a bunch of CSV files - exact same CSV layout used by each file. A file needs to be read, processed, and a log file created.
Will you write a Java program that loops through the files, for each file found, write a Java program for processing that file, compile it, then execute it?
Or would you write a Java program that takes the name of the file as input, and then process that file and writes the log file?
The 2nd approach provides a program that can process any of those CSV files - one simply needs to pass the filename as an input parameter.
Your code and approach use the 1st method. Not the 2nd. And that is why it is wrong.
To create a SQL program with parameters is done by using bind variables. Instead of
v_cmd := 'UPDATE parts_categ_counts SET w1='||v1||', w2='||v2||...||v9||' WHERE seq='||vseq||';
The following SQL source code should be created:
v_cmd := 'UPDATE parts_categ_counts SET w1=:v1, w2=:v2 ..., w9=:v9 WHERE seq= :vseq';
The tokens with the colon prefix (such as :v1), are bind variables. Think of these as the parameters to the SQL cursor.
The server parses this SQL into a cursor. You can now execute the same cursor over and over again, using different bind variables. (just like the 2nd approach above that one would use in Java)
In PL/SQL, this is made even easier as you can code native SQL code with PL/SQL code and use PL/SQL variables in it. The PL/SQL compiler is clever enough to do the SQL parsing, variable binding, and cursor execution for you. So in PL/SQL, you would use:
UPDATE parts_categ_counts SET w1=v1, w2=v2 ..., w9=v9 WHERE seq= vseq;
Where v1 and the others are PL/SQL variables.
That all said - PL/SQL is only used for data crunching, when the processing of data is too complex for the SQL language to deal with. And this is very seldom the case.
The main reason for using PL/SQL it to provide processing flow control, conditional processing and error handling, for SQL code. As the SQL language does not have these features. -
Install Sun ONE Directory Server 5,2 & how to use it for authenticate user
Good afternoon, Excuse, are newbie in the scope I am learning and putting desire to him, this in my situation I am trying to install Sun ONE Directory Server 5,2 since I understand that this it is application LDAP for Solaris, ok I want to install it to authenticate user against the system, that is to say, to be able to acces the server entering with a created user from the data base of LDAP and make think user that his created in the system. But the documentation that I finds indicates the installation of Sun ONE Directory Server 5,2 but it not clearly about how to use it for authentication. Some one have any manual step by step of Sun ONE Directory Server 5,2 installation and how to make it for authentication systems users.
I read the forum seeking for anwser and i get confuse
Thanks for the help and sorry for any inconvenient
Message was edited by:
Aku_28
Message was edited by:
Aku_28I think that I found the Sun endorsed book locations for using LDAP accounts that don't use authentication besides "crypt". I now can use an account with a "ssha" password. It can be more than 8 characters long.
Chapter 14 System Administration Guide: Naming and Directory Services
Read page 201 which is the pam.conf file pam_ldap setups. I edited my "/etc/pam.conf" file to reflect this
Chapter 7 Directory Server 5.2 2005Q4 - Administration Guide
Read page 316-318 which has a graphical technique to specify password syntax. I set it up and then tried the password by running "su - brahms". It now requires a longer password than 8 characters and it is set up to use "ssha" for that UID entry "brahms". -
How to use parathesis for OR and AND OPERATOR...
oracle 10g
Hi
Guys please help how to use parathesis for this below query its giving same output values for all my similar queries
select count(balance) from balanace_tb
where kk_code in(111,112,113)
or
kk_code in(111,1124,115,116) and sec_id in(50,51,52,53)
or
kk_code in(100,164,215,161) and sec_id in(53,51,52,59)
or
kk_code not in(100,164,215,162,134) and sec_id in(53,51,52,59)
or
kk_code in(100,164,215,16) and sec_id in(53,51,52,59)
and
open_date=20130331I assume you're looking for something like this?
select count(balance) from balanace_tb
where ( kk_code in(111,112,113)
or (kk_code in(111,1124,115,116) and sec_id in(50,51,52,53))
or (kk_code in(100,164,215,161) and sec_id in(53,51,52,59))
or (kk_code not in(100,164,215,162,134) and sec_id in(53,51,52,59))
or (kk_code in(100,164,215,16) and sec_id in(53,51,52,59))
and open_date=20130331
If not, please post some example data, the expected output from that data, and the logic you are expecting to use, as well as posting your database version.
Re: 2. How do I ask a question on the forums? -
How to Use BAPI_OUTB_DELIVERY_CHANGE for Batch Split
Hi Experts, I have the follow delivery:
Item Material Deliv.Qty Un
10 739911 2 PQT
And I want to obtain this:
Item Material Deliv.Qty Un Batch
10 739911 0 PQT
900001 739911 1 PQT ZZ00060
900002 739911 1 PQT ZZ00061
But, after using the Bapi I obtained this:
Item Material Deliv.Qty Un Batch
10 739911 1,372 PQT
900001 739911 0,314 PQT ZZ00060
900002 739911 0,314 PQT ZZ00061
So as you can see the problem is with the "Deliv.Qty". I expected:
Item Deliv.Qty
10 0
900001 1
900002 1
But I obtained:
Item Deliv.Qty
10 1,372
900001 0,314
900002 0,314
The parameters that I am using in the Bapi are:
HEADER_DATA
DELIV_NUMB = 801174646
HEADER_CONTROL
DELIV_NUMB = 801174646
DELIVERY = 801174646
TECHN_CONTROL
UPD_IND = U
ITEM_DATA (three records):
DELIV_NUMB = 801174646
DELIV_ITEM = 000010
MATERIAL = 739911
FACT_UNIT_NOM = 1
FACT_UNIT_DENOM = 1
DELIV_NUMB = 801174646
DELIV_ITEM = 900001
MATERIAL = 739911
BATCH = ZZ00060
HIERARITEM = 000010
USEHIERITM = 1
DLV_QTY = 1
DLV_QTY_IMUNIT = 1
FACT_UNIT_NOM = 1
FACT_UNIT_DENOM = 1
DELIV_NUMB = 801174646
DELIV_ITEM = 900002
MATERIAL = 739911
BATCH = ZZ00061
HIERARITEM = 000010
USEHIERITM = 1
DLV_QTY = 1
DLV_QTY_IMUNIT = 1
FACT_UNIT_NOM = 1
FACT_UNIT_DENOM = 1
ITEM_CONTROL (three records):
DELIV_NUMB = 801174646
DELIV_ITEM = 000010
CHG_DELQTY = X
DELIV_NUMB = 801174646
DELIV_ITEM = 900001
CHG_DELQTY = X
DELIV_NUMB = 801174646
DELIV_ITEM = 900002
CHG_DELQTY = X
So I am missing something but I don't know what.
Can any one help me with this please?
PD: I have looked the following forums in order to use the Bapi:
How to Use BAPI_OUTB_DELIVERY_CHANGE for Batch Split
batch split using BAPI_OUTB_DELIVERY_CHANGE
Re: Help in BAPI_OUTB_DELIVERY_CHANGE(batch-split)
BAPI_OUTB_DELIVERY_CHANGE - Batch Splits don't work
Help for BAPI_OUTB_DELIVERY_CHANGEHey,
My code is for the inbound delivery but it should work the same.
Give this a try.
REPORT z_delivery_batch_split.
DATA:header_data LIKE bapiibdlvhdrchg,
header_control LIKE bapiibdlvhdrctrlchg,
delivery LIKE bapiibdlvhdrchg-deliv_numb,
ls_return LIKE bapiret2,
item_data TYPE TABLE OF bapiibdlvitemchg,
item_control TYPE TABLE OF bapiibdlvitemctrlchg,
ls_item_data LIKE bapiibdlvitemchg,
ls_item_control LIKE bapiibdlvitemctrlchg,
return TYPE TABLE OF bapiret2 WITH NON-UNIQUE KEY type.
header_data-deliv_numb = '1800005005'.
header_control-deliv_numb = '1800005005'.
delivery = '1800005005'.
ls_item_data-deliv_numb = '1800005005'.
ls_item_data-deliv_item = '900001'.
ls_item_data-material = '000000000020067722'.
PERFORM create_batch CHANGING ls_item_data-batch.
ls_item_data-hieraritem = '000010'.
ls_item_data-usehieritm = '1'.
ls_item_data-dlv_qty = 80.
ls_item_data-dlv_qty_imunit = 80.
ls_item_data-fact_unit_nom = '1'.
ls_item_data-fact_unit_denom = '1'.
ls_item_data-sales_unit = 'EA'.
ls_item_data-base_uom = 'EA'.
APPEND ls_item_data TO item_data.
ls_item_data-deliv_numb = '1800005005'.
ls_item_data-deliv_item = '900002'.
ls_item_data-material = '000000000020067722'.
PERFORM create_batch CHANGING ls_item_data-batch.
ls_item_data-hieraritem = '000010'.
ls_item_data-usehieritm = '1'.
ls_item_data-dlv_qty = 60.
ls_item_data-dlv_qty_imunit = 60.
ls_item_data-fact_unit_nom = '1'.
ls_item_data-fact_unit_denom = '1'.
ls_item_data-sales_unit = 'EA'.
ls_item_data-base_uom = 'EA'.
APPEND ls_item_data TO item_data.
ls_item_control-deliv_numb = '1800005005'.
ls_item_control-deliv_item = '900001'.
ls_item_control-chg_delqty = 'X'.
APPEND ls_item_control TO item_control.
ls_item_control-deliv_numb = '1800005005'.
ls_item_control-deliv_item = '900002'.
ls_item_control-chg_delqty = 'X'.
APPEND ls_item_control TO item_control.
break cgavin.
CALL FUNCTION 'BAPI_INB_DELIVERY_CHANGE'
EXPORTING
header_data = header_data
header_control = header_control
delivery = delivery
* TECHN_CONTROL = TECHN_CONTROL
TABLES
* HEADER_PARTNER = HEADER_PARTNER
* HEADER_PARTNER_ADDR = HEADER_PARTNER_ADDR
* HEADER_DEADLINES = HEADER_DEADLINES
item_data = item_data
item_control = item_control
* ITEM_SERIAL_NO = ITEM_SERIAL_NO
* EXTENSION1 = EXTENSION1
* EXTENSION2 = EXTENSION2
return = return
* TOKENREFERENCE = TOKENREFERENCE
* HANDLING_UNIT_HEADER = HANDLING_UNIT_HEADER
* HANDLING_UNIT_ITEM = HANDLING_UNIT_ITEM
* PARTIAL_GR_OBJECTS = PARTIAL_GR_OBJECTS
READ TABLE return
INTO ls_return
WITH TABLE KEY type = 'E'.
IF sy-subrc = 0.
MESSAGE ID ls_return-id TYPE ls_return-type NUMBER ls_return-number WITH ls_return-message_v1 ls_return-message_v2
ls_return-message_v3 ls_return-message_v4.
ENDIF.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'.
break cgavin.
*& Form CREATE_BATCH
* text
* <--P_LS_ITEM_DATA_BATCH text
FORM create_batch CHANGING p_ls_item_data_batch.
DATA: ls_bncom TYPE bncom.
ls_bncom-matnr = ls_item_data-material.
ls_bncom-werks = 'C333'.
ls_bncom-lgort = '3000'.
SELECT SINGLE mtart
FROM mara
INTO ls_bncom-mtart
WHERE matnr = ls_bncom-matnr.
CALL FUNCTION 'VB_NEXT_BATCH_NUMBER'
EXPORTING
matnr = ls_bncom-matnr
werks = ls_bncom-werks
check_batch = 'X'
check_material = ''
message_when_auto = ' '
x_bncom = ls_bncom
lock_batch = ' '
IMPORTING
new_charg = p_ls_item_data_batch
EXCEPTIONS
no_material = 1
no_plant = 2
material_not_found = 3
plant_not_found = 4
no_batch_handling = 5
batch_exist = 6
no_number = 7
illegal_batch_number = 8
interval_not_found = 9
object_not_found = 10
interval_overflow = 11
error_automatic_batch_number = 12
cancelled = 13
automatic_batch_num_not_active = 14
OTHERS = 15.
IF sy-subrc = 0.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'.
ENDIF.
ENDFORM. " CREATE_BATCH -
Need documents for how to use OAM for APPS DBAs
Hi All,
Need documents/pdfs, how to use OAM for APPS DBAs.
Thanks a lot in advanceHi,
For R12 ,refer the Oracle E-Business Suite System Administrator's Guide - Configuration part no:E12893-03 (http://download.oracle.com/docs/cd/B53825_04/current/acrobat/121sacg.pdf)
For 11i version pls chk :
Oracle Applications System Administrator's Guide - Configuration (zipped) B13925-06 (http://download.oracle.com/docs/cd/B25516_18/current/acrobat/115sacg.zip)
--Rk -
How to use offset for select-option parameter ?
Hi experts
could anybody please let me know how to use offset for select-option parameter. i can able to use offset for table fields, variabiles and all , but don't know how to use for parameters.
following is my code
SELECT-OPTIONS: s_prctr FOR vbsegs-prctr OBLIGATORY.
here "prctr" length is 10.
i'm using two tables 1. vbsegd-bupla
2. vbsegs-prctr
here prctr+6(4) = bupla.
"Bupla" length is 4
SELECT belnr gjahr bukrs bupla sgtxt buzei FROM vbsegd INTO CORRESPONDING FIELDS OF TABLE it_vbsegd FOR ALL ENTRIES IN it_vbkpf
WHERE belnr = it_vbkpf-belnr
AND gjahr = it_vbkpf-gjahr
AND bukrs = it_vbkpf-bukrs
AND bupla IN s_prctr.
the above statement is not working as prctr and bupla lenths are different. here i want to use offset.
SELECT belnr gjahr bukrs prctr sgtxt buzei FROM vbsegs INTO CORRESPONDING FIELDS OF TABLE it_vbsegs FOR ALL ENTRIES IN it_vbkpf
WHERE belnr = it_vbkpf-belnr
AND gjahr = it_vbkpf-gjahr
AND bukrs = it_vbkpf-bukrs
AND prctr IN s_prctr.
this is working as prctr and s_prctr lengths are equal.
could anybody please help me out in this.
Thanks in advance.
regards
satishBelow code will work for you.
SELECT-OPTIONS: s_prctr FOR vbsegs-prctr OBLIGATORY.
RANGES: s_bupla FOR vbsegd-bupla.
s_bupla[] = s_prctr[].
DELETE ADJACENT DUPLICATES FROM s_bupla.
SELECT belnr gjahr bukrs bupla sgtxt buzei FROM vbsegd INTO CORRESPONDING FIELDS OF TABLE it_vbsegd FOR ALL ENTRIES IN it_vbkpf
WHERE belnr = it_vbkpf-belnr
AND gjahr = it_vbkpf-gjahr
AND bukrs = it_vbkpf-bukrs
AND bupla IN s_bupla. -
How to use stysheet for Swing components?
Hi,
Give me a guidence abt how to use Stylesheet for Swing components to crate good looking GUI...........thnxthank you for your reply,
I want to know how many times a component is refreshed. I'm asumming the RefreshCondition attribute gets called everytime a component gets refreshed, hence it could be counted.
I'm just not sure how to use it. -
How to use multithreading for asynchronous operation
hi! i am really new to java, i want to improve the performance of my code, some suggested to implement asynchronous operation using multithreading. Please help me how to use multithreading for asynchronous operation. thanks in advance.
http://java.sun.com/docs/books/tutorial/essential/threads/
Note, however, that just making something multithreaded won't necessarily improve performance. You either need multiple CPUs or there needs to be some I/O going on that blocks while something else could be done--other I/O or computing. -
HT1414 how to use itune for iphone activation
how to use itune for iphone activation
Get the latest version of iTunes, your Apple ID and just connect the iPhone to your computer and iTunes will guide you through activation.
Maybe you are looking for
-
E72 needs to restart frequently
last 4 months am using my E72 for my communication needs. but the issue with this system is when ever i connected to the data package for checking mails its working perfectly. But once i logged off and disconnect this internet connection the issue s
-
"BLACK" screen after update to 10.5.8
I did the update this afternoon and had a similar issue. Immediately after the reboot from installing the update, the computer came up with a a bunch of operating system information with the last statement saying: "Panic: rebooting....". The screen t
-
MaxT3MessageSize in Weblogic 5.1
I'm trying to set the maximum size for a T3 message using weblogic 5.1, but am unable to find any reference to this parameter using wls 5.1. Did this parameter exist back then? I need to send large JMS messages to a wls 5.1 server. Thanks
-
Annoying Mail problem I've had for so long, please help!
Hi everyone, Since as long as I can remember, whenever I attach a JPG, or EPS in Mail to a message for instance, if I send the email to a PC user, they always tell me that there wasn't an image attached??! Now I always have 'save windows friendly att
-
Programmatic to change the Frame title
Hi all It's not possible programmatic to change the Frame title. Is there any way (not-documented) to change it?