How to declare a workarea of type index table
Hi Experts,
I am getting error as CT_RESULT is a generic type.Use of this type is only possible for typing field symbols and formal parameters when using the below code. Please help me and let me know how to declare it.
TYPES:BEGIN OF ty_guid,
guid TYPE guid,
END OF ty_guid.
DATA:it_guid TYPE STANDARD TABLE OF ty_guid INITIAL SIZE 0,
it_item TYPE STANDARD TABLE OF bbp_pds_sc_item_d INITIAL SIZE 0.
DATA:wa_guid TYPE ty_guid,
wa_item TYPE bbp_pds_sc_item_d.
FIELD-SYMBOLS: <fs_result> like LINE OF ct_result.
SELECT guid FROM crmd_orderadm_h INTO TABLE it_guid
WHERE object_id IN ct_result.
IF sy-subrc = 0.
LOOP AT it_guid INTO wa_guid.
CALL FUNCTION 'BBP_PD_SC_GETDETAIL'
EXPORTING
i_guid = wa_guid
* I_OBJECT_ID =
* I_ATTACH_WITH_DOC = ' '
i_with_itemdata = 'X'
* I_ITEM_SORTED_BY_HIERARCHY =
* I_WITHOUT_HEADER_TOTALS =
* I_READ_FROM_ARCHIVE = ' '
* IMPORTING
* E_HEADER =
* EV_IS_PD =
* ET_ATTACH =
TABLES
e_item = it_item
* E_ACCOUNT =
* E_PARTNER =
* E_CONFIRM =
* E_LONGTEXT =
* E_LIMIT =
* E_ORGDATA =
* E_TAX =
* E_PRIDOC =
* E_HCF =
* E_ICF =
* E_MESSAGES =
* E_ACTVAL =
* E_ACC_ACTVAL =
* E_HEADER_REL =
* E_ITMLIM_REL =
* E_STATUS =
ENDLOOP.
ENDIF.
IF it_item[] IS NOT INITIAL.
LOOP AT it_item INTO wa_item.
LOOP AT ct_result ASSIGNING <fs_result>.
<fs_result>-zzpurchase_cat = wa_item-be_tracking_no.
* MODIFY ct_result FROM wa_result.
CLEAR wa_result.
ENDLOOP.
CLEAR wa_item.
ENDLOOP.
ENDIF.
Hi,
i'm not quite sure where ct_result is first introduced. There seems to be no declaration?
Judging by the name-prefix, it would be a changing parameter of which form?
Where is it populated, since you intend to loop it?
And then, from which hat do you draw wa_result? it neither seems to be declared nor is there an assignment of values.
On the other hand, you're trying to change table ct_result directly by altering a field of an assigned field-symbol. Why do you feel it necessary to follow up with a modify statement?
After so many question-marks i have lost the point of your initial question.
Maybe, you can start with a short description of your intention and a more accurate code-snippet.
Best regards - Jörg
Similar Messages
-
How to modify field symbol of type Index Table with other field symbol of type any.
Hello Experts,
How is it possible to update an filed symbol table of type Index table with other filed symbol table.
e.g.
Field symbol : <lt_table1> type Index table.
Field symbol : <lt_table2> type Index table.
after some code...at run time these table filled like following.
<lt_tabel1 > has value fore column like c11 , c12 , c13
<lt_table2> has value for column like C11 , C12 , C13 , C14 , C15 . some extra values from <lt_table1>
Now I want to be modify <table1> one entires like C12 with <table2 > col C12.
how I can achieve this.
Regards,
Chetan.Hi,
did you try ASSIGN COMPONENT xx OF STRUCTURE <IT_TABEL1> TO <IT_TABLE2>.
xx will contain the number of the column
or maybe, if you have the description with a field catalog or other, that will be easier ..
regards
Fred -
Declare work area of type = standard table
Hi All,
How to declare a workarea of type standard table in ABAP Objects..
the syntax check of ABAP Objects showing error for the general ABAP Code
for the same..
Thanks in Advance, Sudeep..Hi Sudeep,
I had shown the declarations for internal table and work area as well
if you just want work area
just use the second statement
data : is_vbak type vbak. " work area of VBAK
Regards
Gopi -
Exporting Parameter of type 'INDEX TABLE'
Hi Experts,
there is a standard method CL_CRM_MKTPL_OL_TRADE->GET_TRADESPENDS in CRM which has an exporting parameter ET_TRADESPENDS of type INDEX TABLE. Could somebody give me a hint on how to call this method and work with the data that is returned? I am assuming that I will need field symbols for this, correct? Coding examples would be greatly appreciated.
Thanks,
JensHi Jens,
INDEX TABLE is a generic type. The data object expected depends on configuration and/or context. As we don't have any CRM system I can check CL_CRM_MKTPL_OL_TRADE->GET_TRADESPENDS I can't give you the details.
I have some experience with comparable methods in SAP Transportation Managament which uses the BOPF framework. In program context, we know what type of table structure will be expected, so we defined a local table accordingly and passed it to the ET parameter.
If you don't have any idea on how to find out, just declare any internal table, i.e-lt_test type table of string. Then call the method with parameter ET_TRADESPENDS = lt_test. This will dump for sure. Enter debugger and check what kind of data are returned. From the field names you may get a clue what structure it could be. Dump analysis may also provide some info.
Regards,
Clemens -
How to declare a param. of type RANGE OF in a method (or function module)?
Hello,
I've got a following problem.
I want to pass a value of type RANGE OF to a method declared in
an interface (the interface is built using Class Builder). I don't know
how to do that and I did not manage to find a solution using both
SAP help and google.
Did anybody have the same problem before?
Best regards
PawelOk, I find a workaround. Maybe it will be useful for somebody in the future.
Declare the parameter type as ANY TABLE and then cast it to the expected type
in the body of the method.
So for example.
Parameter Type Typing Method Associated Type
I_RNG_DATUM Importing Type ANY TABLE
In the body of the method.
TYPES:
erdat_range TYPE RANGE OF erdat.
FIELD-SYMBOLS:
<l_fs_rng_erdat> TYPE erdat_range.
DATA:
l_ref_to_range TYPE REF TO data.
GET REFERENCE OF i_rng_datum INTO l_ref_to_range.
ASSIGN l_ref_to_range->* TO <l_fs_rng_erdat> CASTING.
However, if somebody know how to pass type RANGE OF
explicitely, the right answer is still welcome.
Best regards
Pawel -
SSIS Programming- How to declare a variable of type Object?
Hello, I have a very specific coding question. I am trying to create a pkg using SSIS Object model. I am trying to create a variable of type Object. But I could not find any reference in KB or forums on creating variable of this data type.
Example:
// Create the package.
Application a = new Application();
Package p = new Package();
p.Name = "MyDataExtractPkg";
//Add Variables to the pkg
Variables pkgVars = p.Variables;
Variable var8 = p.Variables.Add("varHour", false, "User", (System.Int16)0);
Variable var9 = p.Variables.Add("varHourDiff", false, "User", 0);
Variable var10 = p.Variables.Add("varIntervalWaitInMS", false, "User", 5000);
Variable var11 = p.Variables.Add("varJobCnt", false, "User", 0);
Variable var12 = p.Variables.Add("varjobID", false, "User", 0);
Variable var13 = p.Variables.Add("varJobRS", false, "User", (System.Object)0);
Variable var14 = p.Variables.Add("varProcessDate", false, "User", "abc");
As you can see I was able to successfully variables of Type Int16, Int32(default) & String.
But I need to create a variable of type Object for "varJobRS" and above code is generating int. Appreciate any direction or help on how to create Object variable type.
Thanks,
DW GuyI have been continuing with my work with intention to approch MS, but I came across the solution in one of the Blog site. The solution is :
var13.Value =
new
Object();
This converts the variable of type Object.
The link that gave this soluion is:
http://ssisbi.com/building-ssis-packages-programmatically-part-5/
Thanks,
DW Guy -
Assigning a value to a field-symbol (workarea of type any)
Dear forumers,
I'm having a bit of difficulty in assigning a value to a field-symbol (it should be treated as a workarea of type any), but I'm given a syntax error instead:-
The data object "<LFS_WORKAREA>" has no structure and therefore no component called "LFMON".
What could have gone wrong and how may I resolve this (I must have missed something out)? I will still need <LFS_WORKAREA> to be defined as TYPE ANY.
Please help. I'd appreciate any inputs at all. Thanks.
*& Form FORMAT_POST_PERIOD
* Subroutine to format the posting period data
* --> PI_MBEW Material valuation data (internal table)
FORM format_post_period CHANGING pi_mbew TYPE ANY TABLE.
" Create local field symbols
FIELD-SYMBOLS:
<lfs_workarea> TYPE ANY,
<lfs_lfmon> TYPE ckmlcr-poper.
" Create local variables
DATA: lv_index TYPE sy-tabix.
DATA: lv_lfmon TYPE ckmlcr-poper.
" Format posting periods
LOOP AT pi_mbew ASSIGNING <lfs_workarea>.
lv_index = sy-tabix.
ASSIGN COMPONENT 'LFMON' OF STRUCTURE <lfs_workarea> TO <lfs_lfmon>.
PERFORM convert_lfmon USING <lfs_lfmon>
CHANGING lv_lfmon.
MOVE lv_lfmon TO <lfs_workarea>-lfmon. " the syntax error occurs here :(
MODIFY pi_mbew FROM <lfs_workarea>
INDEX lv_index
TRANSPORTING lfmon.
CLEAR: <lfs_workarea>,
<lfs_lfmon>
lv_lfmon,
lv_index.
ENDLOOP.
ENDFORM. " FORMAT_POST_PERIODMost of us aren't in it for the points in any case...
For your solution you've redundant code:
*& Form FORMAT_POST_PERIOD
* Subroutine to format the posting period data
* --> PI_MBEW Material valuation data (internal table)
FORM format_post_period CHANGING pi_mbew TYPE ANY TABLE.
FIELD-SYMBOLS:
<lfs_workarea> TYPE ANY,
<lfs_lfmon> TYPE ckmlcr-poper.
DATA: lv_lfmon TYPE ckmlcr-poper.
* DATA: lo_workarea TYPE REF TO data. "<--Not needed, because the LOOP AT ASSIGNING below does the work
* CREATE DATA lo_workarea LIKE LINE OF pi_mbew.
* ASSIGN lo_workarea->* TO <lfs_workarea>.
LOOP AT pi_mbew ASSIGNING <lfs_workarea>.
ASSIGN COMPONENT 'LFMON' OF STRUCTURE <lfs_workarea> TO <lfs_lfmon>.
PERFORM convert_lfmon USING <lfs_lfmon>
CHANGING lv_lfmon.
<lfs_lfmon> = lv_lfmon.
CLEAR lv_lfmon.
ENDLOOP.
ENDFORM. " FORMAT_POST_PERIOD
Here's a couple of more efficient solutions, using LOOP AT INTO.
FORM format_post_period CHANGING pi_mbew TYPE INDEX TABLE. " <-- Table type a little more specific
"<--now you can use index operations
FIELD-SYMBOLS:
<lfs_workarea> TYPE ANY,
<lfs_lfmon> TYPE ckmlcr-poper.
DATA: lv_lfmon TYPE ckmlcr-poper,
lv_index TYPE sytabix.
DATA: lo_workarea TYPE REF TO data.
CREATE DATA lo_workarea LIKE LINE OF pi_mbew.
ASSIGN lo_workarea->* TO <lfs_workarea>.
ASSIGN COMPONENT 'LFMON' OF STRUCTURE <lfs_workarea> TO <lfs_lfmon>.
LOOP AT pi_mbew INTO <lfs_workarea>.
lv_index = sy-tabix.
PERFORM convert_lfmon USING <lfs_lfmon>
CHANGING lv_lfmon.
<lfs_lfmon> = lv_lfmon.
MODIFY pi_mbew FROM <lfs_workarea>
INDEX lv_index. " <--INDEX TABLE, so this is permitted.
CLEAR lv_lfmon.
ENDLOOP.
ENDFORM. " FORMAT_POST_PERIOD -
Delete by index on type any table
What is the alternative for the forbidden index operations on a fieldsymbol of type any table?
I have a table under a fieldsymbol.. can be any table and I want to delete line 2.. how do I do it?
e.g.
ps_tabname is a parameter pointing to an internal table (unknown at design time)
field-symbols: <fs_tab> type any table.
assign (ps_tabname) to <fs_tab>.
delete <fs_tab> index 2. -> not possible because of any table.. alternative?>
Koenraad Janssens wrote:
> field symbol as standard table does the trick... stupid me
Hello,
This explains why TYPE STANDARD TABLE solves your problem
TYPE ANY TABLE --> Can contain any internal table (INDEX tables which can be either STANDARD or SORTED TABLE & HASH table). As already suggested index cannot be used on hash tables so it was giving you an error.
TYPE INDEX TABLE --> A generic table will be created which allows index access unlike ANY TABLE. Refer: [http://help.sap.com/abapdocu_70/en/ABENINDEX_TABLE_GLOSRY.htm|http://help.sap.com/abapdocu_70/en/ABENINDEX_TABLE_GLOSRY.htm]
BR,
Suhas -
... type standered table ...
Hi All,
Can anybody explain me abt , wat 'standered table of ' means in the below sentence..
TYPES: B is defined here.
DATA: A TYPE STANDERED TABLE OF B.
ThankxHi Sal,
Check this.
TABKIND - Internal Table Types
Alternatives:
1. STANDARD TABLE
2. SORTED TABLE
3. HASHED TABLE
4. INDEX TABLE
5. ANY TABLE
Effect
The table type - set in the DATA, TYPES, orCREATE DATA statement, specifies how the system accesses entries in the internal table in generic key operations.
(READ TABLE itab, DELETE TABLE itab, INSERT TABLE itab, MODIFY TABLE itab, COLLECT itab). As a general rule, the runtime required for key operations depends on the total length of the key.
The various table types have the following hierarchy:
ANY TABLE
|
| |
INDEX TABLE HASHED TABLE
|
| |
STANDARD TABLE SORTED TABLE
Alternative 1
STANDARD TABLE
Effect
Defines the table as a standard table. Key access to a standard table uses a linear search. This means that the timne required for a search is in linear relation to the number of table entries.
You should use index operations to access standard tables.
For the sake of compatibility, you can use TABLE as a synonym of STANDARD TABLE.
Alternative 2
SORTED TABLE
Effect
Defines the table as one that is always saved correctly sorted. Key access to a sorted table uses a binary key. If the key is not unique, the system takes the entry with the lowest index. The runtime required for key access is logarithmically related to the number of table entries.
You can also access sorted tables by index operations. When you insert using an index, the system checks to ensure that the sort sequence has been correctly maintained. For this reason, it takes longer than inserting entries in a standard table. As a rule, you should only access sorted tables using their key.
Alternative 3
HASHED TABLE
Effect
Defines the table as one that is managed with an internal hash procedure. You can imagine a hashed table as a set, whose elements you can address using their unique key. Unlike standard and sorted tables, you cannot access hash tables using an index. All entries in the table must have a unique key. Access time using the key is constant, regardless of the number of table entries.
You can only access a hashed table using the generic key operations or other generic operations ( SORT, LOOP, and so on). Explicit or implicit index operations (such as LOOP ... FROM oe INSERT itab within a LOOP) are not allowed.
Alternative 4
INDEX TABLE
Effect
Standard and sorted tables belong to the generic class index tables. An index table is one that you can access using an index. You can currently only use the table type INDEX TABLE to specify the type of generic parameters in a FORM or a FUNCTION. Hashed tables are not index tables, and cannot therefore be passed to parameters defined as INDEX TABLE.
Alternative 5
ANY TABLE
Effect
Like INDEX TABLE, you use ANY TABLE to specify the type of any generic table parameter. The set of permitted operations for a table with type ANY TABLE consists of the intersection of all permitted operations for STANDARD, SORTED and HASHED TABLEs, and so is identical to the set of operations permitted for hashed tables.
Note in particular that you cannot use index access for tables with this type.
Reward If Useful.
Regards,
Chitra -
How to declare a bind variable with 'date' data type in command prompt?
how to declare a bind variable with 'date' data type in command prompt?
sql>variable q date;
when i execute it show list of datatypesHi,
As Lokanath said, there are no DATE bind variables.
You can use a VARCHAR2 bind variable, and convert it to a DATE in your SQL statment.
If you're using SQL*Plus, consider a substitution variable. It won't be as efficient as a bind variable, but it will be as convenient.
For example:
DEFINE first_entrry_date = "DATE '2010-06-20''
SELECT ...
WHERE entry_date >= &first_entry_date
{code} -
How to declare variable for Table type in the ABAP Editor
Hi!
I have Table Type 'FIELDNAME_TAB' (Table of fieldnames). I want to pass the list of fieldnames to this Table Type in the ABAP Editor.
Can anyone help me in this?You would declare the internal table like so.
data: itab type FIELDNAME_TAB.
data: wa like line of itab.
wa = 'This_value'.
append wa to itab.
Regards.
Rich Heilman
Message was edited by:
Rich Heilman -
How to declare value binding to array list element in a pojo?
I have a POJO called P, that contains an ArrayList member called w.
class P {
private ArrayList w = new ArrayList(5);
w is initied in the class constructor.
The POJO is in the SessionBean and I would like to reference individual
elements in the ArrayList via a value binding like so;
#{SessionBean1.instanceOfP.w[5]}
I'm not sure how to declare the getter/setter for member W in POJO P
so that setter and getter injection work.You may not be able to directly set the indexed value.
Try some thing like this.
Add a property that returns the indexed value.
Ex. if you ArrayList objets are of type "String"
int index = 5;
public String getMyValue(){
return w.get[index]
Now your value binding would look something like
#{SessionBean1.myValue}
BTW, if you want to access different index, create another method
public void setIndex(int index){
this.index = index;
- Winston
http://blogs.sun.com/roller/page/winston?catname=Creator -
How to declare in anonymous block
Declare
CURSOR c_je2acct_othr
IS
SELECT j.jemq_num, j.ml_retail_account,
-- (CASE WHEN j.exer_type = 4 THEN j.sar_shares ELSE j.shares END) shares, -- removed * -1 from sar_shares Manu 12/02/04
/* Commented 02/01/07*/
(CASE WHEN j.exer_type = 4 THEN
fn_get_shares(u.user_id,u.exer_num,u.soc_sec,j.
sar_shares)
ELSE (case when u.exer_type=2 and u.opts_exer!=u.shrs_sold and j.shares=u.shrs_sold then 0 else j.shares end)
END) shares,
-- removed * -1 from sar_shares Manu 12/02/04
j.name_first,
j.name_last, j.exer_type, j.ml_sec_num, j.ivr_plan_num,
j.exer_dt, j.grant_dt, j.user_id, j.mlu_rowid, j.settle_dt,
j.exer_num, j.plan_type, j.grant_num, j.acct_num_othr,
j.add_cancel,
/* (CASE WHEN j.exer_type = 4 THEN j.sar_cash_amount * -1 -- turned negative Manu 12/02/04 ml_retail distr
commented the above line for calculation of proceeds into other account for sar sale.
(CASE WHEN j.exer_type = 4 THEN
Pk_Xop_Citibank_Forex.fn_get_netamount(u.user_id,u.
exer_num,u.soc_sec,
u.sar_cash_amount,NVL(u.comm_value, 0),
NVL(u.tot_fee, 0),
NVL(u.multi_curr_handling_fee, 0))
-- Removed the negative as on ml_exer_upload all values are +ve.
ELSE
( (DECODE(u.exer_type,0,u.opts_exer * u.mkt_prc,u.shrs_sold * u.mkt_prc
- ( ROUND((u.opts_exer * NVL (u.opt_prc, 0)),2)
-- SPIF 39060 Added a Round of condition.
+ DECODE (NVL (u.shrs_wthld_for_taxes, 'N'),
'Y', 0,
ROUND (u.tot_tax, 2)
+ u.tot_fee
+ NVL(u.multi_curr_handling_fee,0)
+ u.comm_value
- u.backup_withholding
END ) AS gl_amt,
T.je_othr_mlacct_jemsg AS vc_trailer_desc,
u.opts_exer ,
u.shrs_sold,
u.rsu_type
FROM TB_XOP_JEMQ j, TB_ML_EXER_UPLOAD u, TB_FC_COMPY T
WHERE j.q_flag = 'N' AND u.je_flag = 'Y'
AND j.entry_dttime >= TRUNC (SYSDATE)
AND j.entry_dttime < TRUNC (SYSDATE) +1
AND j.source = 'X'
AND j.acct_num_othr != ' '
and (case when u.exer_type=2 and u.opts_exer!=u.shrs_sold then (case when j.shares=u.shrs_sold then 0 else 1 end) else 1 end)=1 FIx for PCTUP00566081
AND ( disp_flag <> 'D' OR disp_flag IS NULL ) Added by MARAN ARUNACHALAM on 01/25/2011 for PCTUP00493542 Fix
and j.current_status = '2Q' removed not required now in new plan
AND NOT EXISTS (
SELECT 1
FROM TB_XOP_JEMQ j2
WHERE j2.prev_jemq = j.jemq_num
AND source = 'T'
AND j.add_cancel = j2.add_cancel
AND j.user_id = j2.user_id
AND j.exer_num = j2.exer_num)
AND j.mlu_rowid = u.ROWID
AND 'CMS'||T.compy_acronym||'_USER' = j.user_id
ORDER BY add_cancel DESC;
v_mlac_mesg VARCHAR2(1000);
-- JE_OTHR_MLACCT_JEMSG
BEGIN
dbms_output.put_line('success');
FOR v_je2acct_othr IN c_je2acct_othr
LOOP
dbms_output.put_line('success1');
BEGIN
dbms_output.put_line('success2');
IF v_je2acct_othr.add_cancel = 'C'
THEN
dbms_output.put_line('success3');
UPDATE TB_XOP_JEMQ
SET add_cancel = DECODE(current_status,
'RJ',
add_cancel,
'C'),
q_flag = DECODE(current_status, 'RJ', q_flag, 'N'),
activ_dt = DECODE(current_status,
'RJ',
activ_dt,
SYSDATE)
WHERE prev_jemq = v_je2acct_othr.jemq_num
AND user_id = v_je2acct_othr.user_id
AND exer_num = v_je2acct_othr.exer_num
AND source ='T';
dbms_output.put_line('success4');
ELSIF v_je2acct_othr.add_cancel = 'A'
THEN
dbms_output.put_line('success5');
-- manipulating amount and shares to transfer when different exercise types
v_je2acct_othr.gl_amt :=( CASE
WHEN v_je2acct_othr.exer_type = 0 THEN 0
WHEN v_je2acct_othr.exer_type = 2 AND v_je2acct_othr.opts_exer
!= v_je2acct_othr.shrs_sold
THEN v_je2acct_othr.gl_amt
WHEN v_je2acct_othr.exer_type = 2 AND v_je2acct_othr.opts_exer =
v_je2acct_othr.shrs_sold
THEN v_je2acct_othr.gl_amt
ELSE v_je2acct_othr.gl_amt
END );
---- Commented on 11/01/2006 For Fixing 30585
/* v_je2acct_othr.shares :=( CASE
WHEN v_je2acct_othr.exer_type = 0 THEN v_je2acct_othr.opts_exer
WHEN v_je2acct_othr.exer_type = 2 AND v_je2acct_othr.opts_exer != v_je2acct_othr.shrs_sold
THEN v_je2acct_othr.opts_exer - v_je2acct_othr.shrs_sold
WHEN v_je2acct_othr.exer_type = 2 AND v_je2acct_othr.opts_exer = v_je2acct_othr.shrs_sold
THEN 0
ELSE v_je2acct_othr.shares
END );*/
---- Commented on 11/01/2006 For Fixing 30585
v_je2acct_othr.shares :=( CASE
WHEN v_je2acct_othr.exer_type = 0 THEN v_je2acct_othr.
Shares
--- Replaced opts_exer with the Shares amount from the previous journal for fixing 30585
WHEN v_je2acct_othr.exer_type = 2 AND v_je2acct_othr.opts_exer
!= v_je2acct_othr.shrs_sold and v_je2acct_othr.shares!=0 and v_je2acct_othr.plan_type <> 0 -- Added plantype condition for CQ:PCTUP00493542
THEN v_je2acct_othr.Shares - v_je2acct_othr.shrs_sold
--- Replaced opts_exer with the Shares amount from the previous journal for fixing 30585
WHEN v_je2acct_othr.exer_type = 2 AND v_je2acct_othr.opts_exer =
v_je2acct_othr.shrs_sold
THEN 0
ELSE v_je2acct_othr.shares
END );
dbms_output.put_line('success6');
IF LENGTH(TRIM(v_je2acct_othr.acct_num_othr))=8 OR TRIM(v_je2acct_othr.acct_num_othr) IS NULL
THEN
v_mlac_mesg :=NULL;
ELSE
v_mlac_mesg :='Check the ml a/c length';
dbms_output.put_line('success7');
END IF;
INSERT INTO TB_XOP_JEMQ
(jemq_num,
prev_jemq,
ml_retail_account,
wcma_shares,
shares, wcma_taxes, tax_amt,
wcma_reimburse,
reimburse_amt,
name_first,
name_last, exer_type,
ml_sec_num, wcma_bulking, bulking_amt,
ivr_plan_num,
exer_dt, grant_dt,
user_id, source,
mlu_rowid, settle_dt,
exer_num, plan_type,
grant_num,
vc_trailer_desc, rsu_type
VALUES (Pk_Xop_Get_Jemqnum.fn_xop_get_jemqnum,
v_je2acct_othr.jemq_num,
v_je2acct_othr.acct_num_othr,
-- 2nd ml_retail_account,
v_je2acct_othr.ml_retail_account,
-- move shares from old acct to 2nd acct above
v_je2acct_othr.shares,
--this is SHARES
--wcma_taxes
0,
--tax_amt,
v_je2acct_othr.ml_retail_account,
-- move gl_amt from old acct to 2nd acct above
v_je2acct_othr.gl_amt * -1,
v_je2acct_othr.name_first,
v_je2acct_othr.name_last, v_je2acct_othr.
exer_type,
v_je2acct_othr.ml_sec_num, ' ',
--wcma_bulking,
0,
--bulking_amt,
v_je2acct_othr.ivr_plan_num,
v_je2acct_othr.exer_dt, v_je2acct_othr.
grant_dt,
v_je2acct_othr.user_id, 'T',
--source
v_je2acct_othr.mlu_rowid, v_je2acct_othr.
settle_dt,
v_je2acct_othr.exer_num, v_je2acct_othr.
plan_type,
v_je2acct_othr.grant_num,
v_je2acct_othr.vc_trailer_desc,
v_je2acct_othr.
rsu_type
dbms_output.put_line('success8');
END IF;
EXCEPTION
WHEN OTHERS
THEN
Pr_Xop_Log_Errors ( 'Code :'
|| NVL(v_mlac_mesg,SQLERRM)
|| ' at '
|| USER
|| 'at sub exec block in pop_je2acct_othr'
END;
dbms_output.put_line('success9'); -- end of begin within loop
END LOOP;
--COMMIT;
EXCEPTION
WHEN OTHERS
THEN
Pr_Xop_Log_Errors ( 'Code :'
|| NVL(v_mlac_mesg,SQLERRM)
|| ' at '
|| USER
|| 'at pk_xop_jemq.pop_je2acct_othr'
dbms_output.put_line('success10');
END;}
{ORA-06550: line 10, column 31:
PL/SQL: ORA-00904: "FN_GET_SHARES": invalid identifier
ORA-06550: line 6, column 11:
PL/SQL: SQL Statement ignored
ORA-06550: line 81, column 17:
PLS-00364: loop index variable 'V_JE2ACCT_OTHR' use is invalid
ORA-06550: line 81, column 14:
PL/SQL: Statement ignored}
HI friends, as i am getting two errors when running code in the anonymous block, then how to declare that 2 errors in declare section plz guide me}Noone, will read your code unless it is formatted like below. See the comments added
DECLARE
CURSOR c_je2acct_othr
IS
SELECT j.jemq_num,
j.ml_retail_account,
-- (CASE WHEN j.exer_type = 4 THEN j.sar_shares ELSE j.shares END) shares, -- removed * -1 from sar_shares Manu 12/02/04
/* Commented 02/01/07*/
CASE
WHEN j.exer_type = 4
--"The current user is not seeing the below function fn_get_shares.Privilege issue probably.
THEN fn_get_shares(u.user_id,u.exer_num,u.soc_sec,j. sar_shares)
ELSE (
CASE
WHEN u.exer_type=2
AND u.opts_exer!=u.shrs_sold
AND j.shares =u.shrs_sold
THEN 0
ELSE j.shares
END)
END) shares,
-- removed * -1 from sar_shares Manu 12/02/04
j.name_first,
j.name_last,
j.exer_type,
j.ml_sec_num,
j.ivr_plan_num,
j.exer_dt,
j.grant_dt,
j.user_id,
j.mlu_rowid,
j.settle_dt,
j.exer_num,
j.plan_type,
j.grant_num,
j.acct_num_othr,
j.add_cancel,
/* (CASE WHEN j.exer_type = 4 THEN j.sar_cash_amount * -1 -- turned negative Manu 12/02/04 ml_retail distr
commented the above line for calculation of proceeds into other account for sar sale.
CASE
WHEN j.exer_type = 4
THEN Pk_Xop_Citibank_Forex.fn_get_netamount(u.user_id,u. exer_num,u.soc_sec, u.sar_cash_amount,NVL(u.comm_value, 0), NVL(u.tot_fee, 0), NVL(u.multi_curr_handling_fee, 0))
-- Removed the negative as on ml_exer_upload all values are +ve.
ELSE ( (DECODE(u.exer_type,0,u.opts_exer * u.mkt_prc,u.shrs_sold * u.mkt_prc )) - ( ROUND((u.opts_exer * NVL (u.opt_prc, 0)),2)
-- SPIF 39060 Added a Round of condition.
+ DECODE (NVL (u.shrs_wthld_for_taxes, 'N'), 'Y', 0, ROUND (u.tot_tax, 2) ) + u.tot_fee + NVL(u.multi_curr_handling_fee,0) + u.comm_value ) - u.backup_withholding )
END ) AS gl_amt,
T.je_othr_mlacct_jemsg AS vc_trailer_desc,
u.opts_exer ,
u.shrs_sold,
u.rsu_type
FROM TB_XOP_JEMQ j,
TB_ML_EXER_UPLOAD u,
TB_FC_COMPY T
WHERE j.q_flag = 'N'
AND u.je_flag = 'Y'
AND j.entry_dttime >= TRUNC (SYSDATE)
AND j.entry_dttime < TRUNC (SYSDATE) +1
AND j.source = 'X'
AND j.acct_num_othr != ' '
--and (case when u.exer_type=2 and u.opts_exer!=u.shrs_sold then (case when j.shares=u.shrs_sold then 0 else 1 end) else 1 end)=1 -- FIx for PCTUP00566081
--AND ( disp_flag <> 'D' OR disp_flag IS NULL ) -- Added by MARAN ARUNACHALAM on 01/25/2011 for PCTUP00493542 Fix
--and j.current_status = '2Q' -- removed not required now in new plan
AND NOT EXISTS
(SELECT 1
FROM TB_XOP_JEMQ j2
WHERE j2.prev_jemq = j.jemq_num
AND source = 'T'
AND j.add_cancel = j2.add_cancel
AND j.user_id = j2.user_id
AND j.exer_num = j2.exer_num
AND j.mlu_rowid = u.ROWID
AND 'CMS'
||T.compy_acronym
||'_USER' = j.user_id
ORDER BY add_cancel DESC;
v_mlac_mesg VARCHAR2(1000);
-- JE_OTHR_MLACCT_JEMSG
BEGIN
dbms_output.put_line('success');
FOR v_je2acct_othr IN c_je2acct_othr
LOOP
dbms_output.put_line('success1');
BEGIN
dbms_output.put_line('success2');
IF v_je2acct_othr.add_cancel = 'C' THEN
dbms_output.put_line('success3');
UPDATE TB_XOP_JEMQ
SET add_cancel = DECODE(current_status, 'RJ', add_cancel, 'C'),
q_flag = DECODE(current_status, 'RJ', q_flag, 'N'),
activ_dt = DECODE(current_status, 'RJ', activ_dt, SYSDATE)
WHERE prev_jemq = v_je2acct_othr.jemq_num
AND user_id = v_je2acct_othr.user_id
AND exer_num = v_je2acct_othr.exer_num
AND source ='T';
dbms_output.put_line('success4');
ELSIF v_je2acct_othr.add_cancel = 'A' THEN
dbms_output.put_line('success5');
-- manipulating amount and shares to transfer when different exercise types
--"You cannot assign values to the recor variable declared for a loop. Either define seperate variables or use explicit record variable"
v_je2acct_othr.gl_amt :=
CASE
WHEN v_je2acct_othr.exer_type = 0 THEN
0
WHEN v_je2acct_othr.exer_type = 2 AND v_je2acct_othr.opts_exer != v_je2acct_othr.shrs_sold THEN
v_je2acct_othr.gl_amt
WHEN v_je2acct_othr.exer_type = 2 AND v_je2acct_othr.opts_exer = v_je2acct_othr.shrs_sold THEN
v_je2acct_othr.gl_amt
ELSE
v_je2acct_othr.gl_amt
END );
---- Commented on 11/01/2006 For Fixing 30585
/* v_je2acct_othr.shares :=( CASE
WHEN v_je2acct_othr.exer_type = 0 THEN v_je2acct_othr.opts_exer
WHEN v_je2acct_othr.exer_type = 2 AND v_je2acct_othr.opts_exer != v_je2acct_othr.shrs_sold
THEN v_je2acct_othr.opts_exer - v_je2acct_othr.shrs_sold
WHEN v_je2acct_othr.exer_type = 2 AND v_je2acct_othr.opts_exer = v_je2acct_othr.shrs_sold
THEN 0
ELSE v_je2acct_othr.shares
END );*/
---- Commented on 11/01/2006 For Fixing 30585
v_je2acct_othr.shares :=
CASE
WHEN v_je2acct_othr.exer_type = 0 THEN
v_je2acct_othr. Shares
--- Replaced opts_exer with the Shares amount from the previous journal for fixing 30585
WHEN v_je2acct_othr.exer_type = 2 AND v_je2acct_othr.opts_exer != v_je2acct_othr.shrs_sold AND v_je2acct_othr.shares!=0 AND v_je2acct_othr.plan_type 0 -- Added plantype condition for CQ:PCTUP00493542
THEN
v_je2acct_othr.Shares - v_je2acct_othr.shrs_sold
--- Replaced opts_exer with the Shares amount from the previous journal for fixing 30585
WHEN v_je2acct_othr.exer_type = 2 AND v_je2acct_othr.opts_exer = v_je2acct_othr.shrs_sold THEN
0
ELSE
v_je2acct_othr.shares
END );
dbms_output.put_line('success6');
IF LENGTH(TRIM(v_je2acct_othr.acct_num_othr))=8 OR TRIM(v_je2acct_othr.acct_num_othr) IS NULL THEN
v_mlac_mesg :=NULL;
ELSE
v_mlac_mesg :='Check the ml a/c length';
dbms_output.put_line('success7');
END IF;
INSERT
INTO TB_XOP_JEMQ
jemq_num,
prev_jemq,
ml_retail_account,
wcma_shares,
shares,
wcma_taxes,
tax_amt,
wcma_reimburse,
reimburse_amt,
name_first,
name_last,
exer_type,
ml_sec_num,
wcma_bulking,
bulking_amt,
ivr_plan_num,
exer_dt,
grant_dt,
user_id,
source,
mlu_rowid,
settle_dt,
exer_num,
plan_type,
grant_num,
vc_trailer_desc,
rsu_type
VALUES
Pk_Xop_Get_Jemqnum.fn_xop_get_jemqnum,
v_je2acct_othr.jemq_num,
v_je2acct_othr.acct_num_othr,
-- 2nd ml_retail_account,
v_je2acct_othr.ml_retail_account,
-- move shares from old acct to 2nd acct above
v_je2acct_othr.shares,
--this is SHARES
--wcma_taxes
0,
--tax_amt,
v_je2acct_othr.ml_retail_account,
-- move gl_amt from old acct to 2nd acct above
v_je2acct_othr.gl_amt * -1,
v_je2acct_othr.name_first,
v_je2acct_othr.name_last,
v_je2acct_othr. exer_type,
v_je2acct_othr.ml_sec_num,
--wcma_bulking,
0,
--bulking_amt,
v_je2acct_othr.ivr_plan_num,
v_je2acct_othr.exer_dt,
v_je2acct_othr. grant_dt,
v_je2acct_othr.user_id,
'T',
--source
v_je2acct_othr.mlu_rowid,
v_je2acct_othr. settle_dt,
v_je2acct_othr.exer_num,
v_je2acct_othr. plan_type,
v_je2acct_othr.grant_num,
v_je2acct_othr.vc_trailer_desc,
v_je2acct_othr. rsu_type
dbms_output.put_line('success8');
END IF;
EXCEPTION
WHEN OTHERS THEN
Pr_Xop_Log_Errors ( 'Code :' || NVL(v_mlac_mesg,SQLERRM) || ' at ' || USER || 'at sub exec block in pop_je2acct_othr' );
END;
dbms_output.put_line('success9'); -- end of begin within loop
END LOOP;
--COMMIT;
EXCEPTION
WHEN OTHERS THEN
Pr_Xop_Log_Errors ( 'Code :' || NVL(v_mlac_mesg,SQLERRM) || ' at ' || USER || 'at pk_xop_jemq.pop_je2acct_othr' );
dbms_output.put_line('success10');
END;
{code}   -
How to declare top of page in alv grid disply
Hi
Can any ine let me know how to declare the top -of -page??
Arun JosephHi , check this one u will get easily .
*& Report ZMM_ANNEXURE4_ALV
REPORT ZMM_ANNEXURE4_ALV1.
TYPE-POOLS SLIS .
TABLES : J_1IEXCHDR,
J_1IEXCDTL,
J_1IGRXSUB, " FOR QTY
LFA1, " Vendor Master
ADRC, " Vendor Address
MSEG, " Batch - Identification Marks
MKPF. "
DATA : IT_J_1IEXCHDR LIKE J_1IEXCHDR OCCURS 0 WITH HEADER LINE.
DATA : IT_MSEG LIKE MSEG OCCURS 0 WITH HEADER LINE.
DATA : IT_J_1IEXCDTL LIKE J_1IEXCDTL OCCURS 0 WITH HEADER LINE.
DATA : IT_J_1IGRXSUB LIKE J_1IGRXSUB OCCURS 0 WITH HEADER LINE.
DATA : IT_MSGE LIKE MSEG OCCURS 0 WITH HEADER LINE.
DATA : IT_LFA1 LIKE LFA1 OCCURS 0 WITH HEADER LINE.
DATA : IT_ADRC LIKE ADRC OCCURS 0 WITH HEADER LINE.
DATA : IT_MKPF LIKE MKPF OCCURS 0 WITH HEADER LINE.
data: fieldcatalog type slis_t_fieldcat_alv with header line,
it_listheader type slis_t_listheader,
it_events type slis_t_event,
it_fieldcat type slis_t_fieldcat_alv,
gd_tab_group type slis_t_sp_group_alv,
IS_layout type slis_layout_alv,
SELL_MODE TYPE SLIS_T_SP_GROUP_ALV,
gd_repid like sy-repid.
INCLUDE <symbol>.
INCLUDE <icon>.
*DATA : TEXT1(100) TYPE C.
*DATA : IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.
DATA : V_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
DATA : V_QTY LIKE EKPO-MENGE.
DATA : V_VAL LIKE MARA-NTGEW. " For calculation of Qty
DATA : V_VAL1 TYPE STRING. " For calculation of Qty
DATA : V_Q TYPE STRING. " Variable for calculating
" burning loss
DATA : V_WST TYPE STRING. " Variable 4 WasteM.
DATA : V_WST1 TYPE STRING. " Variable 4 WasteM.
DATA : V_SCPGN LIKE MSEG-MENGE.
DATA : V_WUNIT TYPE STRING.
DATA : V_QFPG1 TYPE STRING.
DATA : V_QFPG2 TYPE STRING.
DATA : V_AQTY TYPE STRING.
DATA : V_QTYR LIKE J_1IEXCDTL-MENGE.
DATA : V_QTYR1 TYPE STRING.
DATA : V_UNTQT TYPE STRING.
DATA : V_MEINS LIKE MSEG-MEINS.
DATA : V_MEINS1 LIKE MSEG-MEINS.
DATA : V_SCPGN1 TYPE STRING.
DATA : V_WSTMQ LIKE MSEG-MENGE.
DATA : V_WSTMQ1 TYPE STRING.
DATA : V_QFPGN LIKE MARA-NTGEW.
DATA : V_VALQ LIKE MARA-NTGEW.
DATA : V_UNITQ LIKE MARA-MEINS.
DATA : V_WGHT TYPE STRING.
DATA : V_WGHT1 TYPE STRING.
DATA : V_CHARG LIKE MSEG-CHARG.
DATA: TEXT TYPE STRING.
DATA: TEXT1 TYPE STRING.
DATA: TEXT2 TYPE STRING.
DATA :TEXT3 TYPE STRING.
DATA :TEXT4 TYPE STRING.
DATA:dat_frt(30).
SELECTION-SCREEN ************
SELECTION-SCREEN COMMENT /80(50) VER.
SELECTION-SCREEN BEGIN OF BLOCK blk2 WITH FRAME TITLE tit2.
SELECT-OPTIONS: P_CHLN FOR IT_J_1IEXCDTL-EXNUM. "NO-EXTENSION
"NO INTERVALS OBLIGATORY.
SELECT-OPTIONS: P_DATE FOR IT_J_1IEXCHDR-BUDAT. "NO-EXTENSION
"NO INTERVALS OBLIGATORY.
SELECTION-SCREEN: END OF BLOCK blk2.
SELECTION-SCREEN COMMENT /72(60) run.
DATA : BEGIN OF IT_FINAL OCCURS 1,
BUDAT type d, "1 Date of issue
MAKTX(40) TYPE C, "2Material Desc
CHAPID(22) TYPE C,
MENGE(18) TYPE C, "4 Qty removed weight
CHARG(25) TYPE C, "5 Identification Marks
ADRS(55) TYPE C," 6For Vendor Address
EXNUM LIKE J_1IEXCHDR-EXNUM, "7 Challan No. & Date
ADDLDATA1(40) TYPE C, "8 NatureProcessReq
DOCNO LIKE J_1IEXCHDR-DOCNO, "10 Document No.
CPUDT TYPE D, "9 Date of Receipt
V_QTY1(40) TYPE C, "10QtyofProcessedFinishedGoods
BURNING(12) TYPE C, "11 Burning Loss
WST_M(20) TYPE c, "12 Qty of waste material
ADDLDATA2(18) TYPE C,"13 Invoice No.&Date
V_PARTIC(25) TYPE C," 14Particulars of Payment
ADDLDATA2 LIKE J_1IEXCHDR-ADDLDATA2,"15 Invoice No.&Date
END OF IT_FINAL.
PERFORM INITIALZATION1.
PERFORM GET_DATA.
PERFORM CALL_FORM.
*& Form INITIALZATION
text
--> p1 text
<-- p2 text
form INITIALZATION1 .
CLEAR IT_FINAL.
CLEAR IT_J_1IEXCHDR.
CLEAR IT_MSEG.
CLEAR IT_J_1IEXCDTL.
CLEAR IT_J_1IGRXSUB.
CLEAR IT_ADRC.
CLEAR V_Q.
CLEAR V_SCPGN.
CLEAR V_WST.
CLEAR V_QFPG1.
CLEAR V_QFPG2.
CLEAR V_VAL.
CLEAR V_VAL1.
CLEAR V_AQTY.
CLEAR V_WUNIT.
CLEAR V_QTYR.
CLEAR V_UNTQT.
CLEAR V_SCPGN1.
CLEAR V_MEINS.
CLEAR V_WSTMQ.
CLEAR V_WSTMQ1.
CLEAR V_QFPGN.
CLEAR V_VALQ.
CLEAR V_UNITQ.
CLEAR V_WGHT.
CLEAR V_WGHT1.
CLEAR IT_FINAL[].
CLEAR IT_J_1IEXCHDR[].
CLEAR IT_MSEG[].
CLEAR IT_J_1IEXCDTL[].
CLEAR IT_J_1IGRXSUB[].
endform. " INITIALZATION
*****INITIALIZATION
INITIALIZATION.
tit2 = 'Selection Criteria'.
CONCATENATE sy-datum6(2) '.' sy-datum4(2) '.' sy-datum+0(4) INTO
dat_frt.
CONCATENATE 'User ID : ' sy-uname ' Client ID : ' sy-mandt
' Run Date : ' dat_frt
INTO run SEPARATED BY space.
ver = 'Developed by CMC Limited. '.
*& Form GET_DATA
text
--> p1 text
<-- p2 text
form GET_DATA .
IF P_DATE <> ''.
SELECT *
FROM J_1IEXCHDR
INTO TABLE IT_J_1IEXCHDR
WHERE BUDAT IN P_DATE AND
TRNTYP = '57FC' AND " Transaction type
SRGRP = 40. " Series Group
ENDIF.
IF P_CHLN <> ''.
SELECT *
FROM J_1IEXCHDR
INTO TABLE IT_J_1IEXCHDR
WHERE EXNUM IN P_CHLN AND
TRNTYP = '57FC' AND " Transaction type
SRGRP = 40. " Series Group
ENDIF.
select *
FROM J_1IEXCDTL
INTO TABLE IT_J_1IEXCDTL
WHERE EXDAT IN P_DATE " Document No.
AND TRNTYP = '57FC'.
" Transaction type for subcontracting
LOOP AT IT_J_1IEXCHDR.
MOVE-CORRESPONDING IT_J_1IEXCHDR TO IT_FINAL.
select MATNR MAKTX CHAPID MENGE MEINS ADDLDATA1 EXNUM
FROM J_1IEXCDTL
INTO (IT_J_1IEXCDTL-MATNR, IT_FINAL-MAKTX,
IT_FINAL-CHAPID,V_QTYR, V_UNTQT,
IT_J_1IEXCDTL-ADDLDATA1, IT_J_1IEXCDTL-EXNUM)
WHERE DOCNO = IT_J_1IEXCHDR-DOCNO " Document No.
AND TRNTYP = '57FC'
" Transaction type for subcontracting
AND RDOC2 = IT_J_1IEXCHDR-RDOC. " Material Doc No.
IT_FINAL-MAKTX = IT_J_1IEXCDTL-MAKTX. " Material Desc
IT_FINAL-CHAPID = IT_J_1IEXCDTL-CHAPID. " Tariff Clasifi
IT_FINAL-MENGE = IT_J_1IEXCDTL-MENGE.
IT_FINAL-MEINS = IT_J_1IEXCDTL-MEINS.
IT_FINAL-ADDLDATA1 = IT_J_1IEXCDTL-ADDLDATA1. " Nature of proc
V_QTYR1 = V_QTYR.
CONCATENATE V_QTYR1 V_UNTQT INTO IT_FINAL-MENGE SEPARATED BY ''.
IF V_UNTQT = 'EA'.
SELECT SINGLE NTGEW GEWEI " VALUE, UNIT
FROM MARA
INTO (V_VALQ, V_UNITQ)
WHERE MATNR = IT_J_1IEXCDTL-MATNR.
V_WGHT = V_VALQ * V_QTYR.
V_WGHT1 = V_WGHT.
CONCATENATE V_WGHT1 V_UNITQ INTO V_WGHT1 SEPARATED BY ''.
CONCATENATE IT_FINAL-MENGE V_WGHT1 INTO IT_FINAL-MENGE
SEPARATED BY ' / '.
ENDIF.
SELECT SINGLE CHARG " Batch No.
FROM MSEG
INTO V_CHARG
WHERE MBLNR = IT_J_1IEXCHDR-RDOC AND " Material Doc No.
MATNR = IT_J_1IEXCDTL-MATNR AND
SHKZG = 'H'. " H- CREDIT
IT_FINAL-CHARG = V_CHARG.
CLEAR V_CHARG.
SELECT SINGLE REC_QTY MBLNR " Qtywaste material,mat docno.
FROM J_1IGRXSUB
INTO (IT_J_1IGRXSUB-REC_QTY, IT_J_1IGRXSUB-MBLNR)
WHERE EXNUM = IT_J_1IEXCHDR-EXNUM." AND
EXC_ZEILE = IT_J_1IEXCHDR-ZEILE.
SELECT SINGLE MENGE " QTY OF WASTE MATERIAL
FROM MSEG
INTO V_SCPGN " VARIABLE STORING QTY OF WASTE MTRL.
WHERE MBLNR = IT_J_1IGRXSUB-MBLNR
AND BWART = 545.
V_WST = V_SCPGN.
SELECT SINGLE MENGE MEINS " QTY OF WASTE MATERIAL
FROM MSEG
INTO (V_WSTMQ, V_MEINS) "VARIABLE STORING QTYOFWASTEMTRL.
WHERE MBLNR = IT_J_1IGRXSUB-MBLNR
AND BWART = 101.
V_WSTMQ1 = V_WSTMQ.
CONCATENATE V_WSTMQ1 V_MEINS INTO V_SCPGN1.
ADDING UNIT 'KG' INTO WASTE MATERIAL.
CONCATENATE V_WST 'KG' INTO IT_FINAL-WST_M.
SELECT SINGLE MATNR
FROM MSEG
INTO IT_MSEG-MATNR
WHERE MBLNR = IT_J_1IGRXSUB-MBLNR
AND BWART = 101.
IF RECEIVED QTY IS IN EA THEN IT SHOULD COME IN KG ALSO
SELECT SINGLE NTGEW GEWEI " VALUE, UNIT
FROM MARA
INTO (V_VAL, V_WUNIT)
WHERE MATNR = IT_MSEG-MATNR.
V_VAL1 = V_VAL.
CONCATENATE V_VAL1 V_WUNIT INTO V_QFPG1 SEPARATED BY ''.
IT_FINAL-V_QTY1 = V_VAL * IT_J_1IGRXSUB-REC_QTY.
V_QFPG2 = V_VAL * IT_J_1IGRXSUB-REC_QTY.
V_QFPGN = V_QFPG2.
CONCATENATE V_QFPG2 V_WUNIT INTO V_QFPG2.
V_AQTY = IT_J_1IGRXSUB-REC_QTY.
IF V_QFPGN <> 0.
CONCATENATE V_SCPGN1 V_QFPG2 INTO IT_FINAL-V_QTY1 SEPARATED BY ' / '.
ELSE.
IT_FINAL-V_QTY1 = V_SCPGN1.
ENDIF.
BURNING LOSS
*Burning Loss = Qty-removed - ( Qty of processed finished goods +
Qty of waste material)
V_Q = V_QTYR - ( V_QFPGN + V_SCPGN ).
IF V_Q GE 0.
CONCATENATE V_Q 'KG' INTO IT_FINAL-BURNING
SEPARATED BY ''.
ELSE.
V_Q = 0.
IT_FINAL-BURNING = V_Q.
ENDIF.
MOVE-CORRESPONDING IT_J_1IEXCHDR TO IT_FINAL.
IT_FINAL-ADDLDATA1 = IT_J_1IEXCDTL-ADDLDATA1. " Nature of proc
APPEND IT_FINAL.
endselect.
LOOP AT IT_FINAL.
SELECT SINGLE adrnr "Adress Number
FROM lfa1
INTO IT_LFA1-adrnr
WHERE lifnr = IT_J_1IEXCHDR-LIFNR.
SELECT " Vendor Address
SINGLE name1 street city1 post_code1 tel_number fax_number
house_num1
FROM adrc
INTO (IT_ADRC-name1,IT_ADRC-street,IT_ADRC-city1,
IT_ADRC-post_code1,
IT_ADRC-tel_number,IT_ADRC-fax_number,IT_ADRC-house_num1)
WHERE addrnumber = it_lfa1-adrnr.
CONCATENATION OF VENDOR NAME & ADDRESS INTO ONE FIELD i.e ADRS.
CONCATENATE IT_ADRC-NAME1 IT_ADRC-STREET IT_ADRC-CITY1
IT_ADRC-POST_CODE1
INTO IT_FINAL-ADRS SEPARATED BY ''.
MODIFY IT_FINAL.
ENDLOOP.
***************CLEAR STATEMENT
CLEAR IT_FINAL.
CLEAR IT_J_1IEXCHDR.
CLEAR IT_MSEG.
CLEAR IT_J_1IEXCDTL.
CLEAR IT_J_1IGRXSUB.
CLEAR IT_ADRC.
CLEAR V_Q.
CLEAR V_SCPGN.
CLEAR V_WST.
CLEAR V_QFPG1.
CLEAR V_QFPG2.
CLEAR V_VAL.
CLEAR V_VAL1.
CLEAR V_AQTY.
CLEAR V_WUNIT.
CLEAR V_QTYR.
CLEAR V_UNTQT.
CLEAR V_SCPGN1.
CLEAR V_MEINS.
CLEAR V_WSTMQ.
CLEAR V_WSTMQ1.
CLEAR V_QFPGN.
CLEAR V_VALQ.
CLEAR V_UNITQ.
CLEAR V_WGHT.
CLEAR V_WGHT1.
ENDLOOP.
CLEAR IT_J_1IEXCHDR[].
CLEAR IT_MSEG[].
CLEAR IT_J_1IEXCDTL[].
CLEAR IT_J_1IGRXSUB[].
endform. " GET_DATA
ADD
form alv_events using events type slis_t_event.
data : wa_events type slis_alv_event.
clear wa_events.
wa_events-name = 'TOP_OF_PAGE'.
wa_events-form = 'TOP_OF_PAGE'.
append wa_events to it_events.
endform. "alv_events
*FORM FOR TOP OF PAGE
form top_of_page.
call function 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = it_listheader.
endform. "top_of_page
FORM fill_fieldcat USING f d o t to p c.
data wa_fieldcat type slis_fieldcat_alv.
statics pos like sy-index value 1.
pos = pos + 1.
clear wa_fieldcat.
MOVE : 1 TO WA_FIELDCAT-ROW_POS,
POS TO WA_FIELDCAT-COL_POS,
F TO WA_FIELDCAT-FIELDNAME,
D TO WA_FIELDCAT-SELTEXT_L,
O TO WA_FIELDCAT-OUTPUTLEN,
T TO WA_FIELDCAT-TABNAME,
TO TO WA_FIELDCAT-DO_SUM,
P TO WA_FIELDCAT-FIX_COLUMN,
C TO WA_FIELDCAT-EMPHASIZE.
move : 1 to wa_fieldcat-row_pos,
pos to wa_fieldcat-col_pos,
f to wa_fieldcat-fieldname,
d to wa_fieldcat-seltext_l,
o to wa_fieldcat-outputlen,
t to wa_fieldcat-tabname,
to to wa_fieldcat-do_sum,
p to wa_fieldcat-fix_column.
append wa_fieldcat to it_fieldcat.
ENDFORM. " fill_fieldcat
*& Form CALL_FORM
text
--> p1 text
<-- p2 text
form CALL_FORM .
perform alv_header using it_listheader.
perform alv_events using it_events.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = SY-REPID
I_INTERNAL_TABNAME = 'IT_FINAL'
I_STRUCTURE_NAME =
I_CLIENT_NEVER_DISPLAY = 'X'
I_INCLNAME = SY-REPID
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE =
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.
For Columns Heading
LOOP AT IT_FIELDCAT INTO V_FIELDCAT.
CASE V_FIELDCAT-FIELDNAME.
WHEN 'BUDAT'.
V_FIELDCAT-SELTEXT_L = 'Date of Issue'.
WHEN 'MAKTX'.
V_FIELDCAT-SELTEXT_L = 'Description of goods (inputs)'.
WHEN 'CHAPID'.
V_FIELDCAT-SELTEXT_L = 'Tarrif Classification'.
WHEN 'MENGE'.
V_FIELDCAT-SELTEXT_L = 'Quantity Removed '.
WHEN 'CHARG'.
V_FIELDCAT-SELTEXT_L = 'Identification Marks, If any'.
WHEN 'ADRS'.
V_FIELDCAT-SELTEXT_L =
'Premises/Factory to which goods removed'.
WHEN 'EXNUM'.
V_FIELDCAT-SELTEXT_L = 'Challan No.'.
WHEN 'ADDLDATA1'.
V_FIELDCAT-SELTEXT_L = 'Nature of Processing required'.
WHEN 'CPUDT'.
V_FIELDCAT-SELTEXT_L = 'Date of Receipt'.
WHEN 'V_QTY1'.
V_FIELDCAT-SELTEXT_L = 'Qty of Processed Finished Goods '.
WHEN 'BURNING'.
V_FIELDCAT-SELTEXT_L = 'Process Loss'.
WHEN 'WST_M'.
V_FIELDCAT-SELTEXT_L = 'Quantity of Waste Material'.
WHEN 'ADDLDATA2'.
V_FIELDCAT-SELTEXT_L = 'Invoice No. & Date'.
WHEN 'V_PARTIC'.
V_FIELDCAT-SELTEXT_L = 'Particulars of Payment of Duty'.
V_FIELDCAT-REF_FIELDNAME = 'ERSDA'.
V_FIELDCAT-REF_TABNAME = 'J_1IEXCDTL'.
WHEN OTHERS. CONTINUE.
ENDCASE.
V_FIELDCAT-SELTEXT_S = V_FIELDCAT-SELTEXT_L.
V_FIELDCAT-SELTEXT_M = V_FIELDCAT-SELTEXT_L.
MODIFY IT_FIELDCAT FROM V_FIELDCAT.
ENDLOOP.
perform fill_layout_structure.
gd_repid = sy-repid.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = sy-repid
I_CALLBACK_TOP_OF_PAGE = 'TOP-OF-PAGE'
IS_LAYOUT = IS_LAYOUT
IT_FIELDCAT = IT_FIELDCAT[]
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = 'A'
IS_VARIANT =
IT_EVENTS = IT_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
I_HTML_HEIGHT_TOP = 0
I_HTML_HEIGHT_END = 0
IT_ALV_GRAPHICS =
IT_HYPERLINK =
IT_ADD_FIELDCAT =
IT_EXCEPT_QINFO =
IR_SALV_FULLSCREEN_ADAPTER =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
t_outtab = IT_FINAL
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.
endform. " CALL_FORM
*& Form FILL_LAYOUT_STRUCTURE
text
--> p1 text
<-- p2 text
form FILL_LAYOUT_STRUCTURE .
data: wa_event type slis_alv_event,
wa_listheader type slis_t_listheader.
clear is_layout.
is_layout-zebra = 'X'.
SELL_MODE = 'D'.
endform. " FILL_LAYOUT_STRUCTURE
*& Form ALV_HEADER
text
-->P_IT_LISTHEADER text
form ALV_HEADER using p_it_listheader.
data : wa_listheader type slis_listheader.
TEXT = 'Annexure - IV'.
clear wa_listheader.
wa_listheader-typ = 'H'.
move TEXT to wa_listheader-info.
append wa_listheader to it_listheader.
TEXT1 = 'Account of Removal of inputs or partially processed goods'.
clear wa_listheader.
wa_listheader-typ = 'S'.
move TEXT1
to wa_listheader-info.
append wa_listheader to it_listheader.
TEXT2 = 'under Sub Rule 5a of Rule of CENVAT Credit Rules, 2002'.
clear wa_listheader.
wa_listheader-typ = 'S'.
move TEXT2 to wa_listheader-info.
append wa_listheader to it_listheader.
TEXT3 = '(to be maintened by assessee who sends raw '.
clear wa_listheader.
wa_listheader-typ = 'S'.
move TEXT3 to wa_listheader-info.
append wa_listheader to it_listheader.
TEXT4 = 'materials/semifinished goods.'.
clear wa_listheader.
wa_listheader-typ = 'S'.
move TEXT4 to wa_listheader-info.
append wa_listheader to it_listheader.
endform. " ALV_HEADER
Regards,
Gulrez Alam -
How to declare a list of dates
Hi,
I have an item which type is "Display as text based on LOV". I put in the source section under the type "Pl/SQL function body" the following pl/sql function :
DECLARE
X VARCHAR2 (4000);
Y DATE ;
BEGIN
X := 'SELECT distinct(TO_CHAR(DATE1, ''YYYY'')) d, (TO_CHAR(DATE1, ''YYYY'')) r FROM SIVOA.EVV_'|| :p4_site ||' WHERE CLEF_VAR = (SELECT CLEF_VAR FROM SIVOA.SITE_DEBIT_RIVIERE WHERE SITE ='''|| :p4_site ||''')
order by d';
EXECUTE IMMEDIATE X INTO Y;
RETURN Y ;
END;The problem is that I get an ORA error.
ORA-00932: types de données incohérents ; attendu : - ; obtenu : -
I know that I have declared Y as a date and that what is returned by my function is a list of dates. I don't know how to declare a list of dates or whatever to be returned as a lis of values. Hope I am clear, sorry for my english.
Thank you for your kind help.
ChristianHi Tony
You hare very patient with me thank you !!!
Let me clarify well.
I am trying to create a list of values based on dates contained in a table. This list of values should contains the "years". If the table contains data for the years 2005, 2006, 2007, then the list of value should return :
2006
2007
2008
As I want a list of value I need to have a display and a return value. The name of the table is 'dynamic' It is the item P4_SITE that contains a part of the name of the table. This is why I am usins PL/SQL, because I don't know the name of the table in advance.
I have not seen any way to put a pl/sql statement in the List of values definition of the item. Thi s is why I try to make a LOV with the SOURCE of the item.
Hope I am clear.
Maybe you are looking for
-
FIM 2010 Sync not running with status "Stopped-extension-dll-exception"
we are getting the following error for all our extensions when trying to run the Sync Operations. All extensions have similar errors with event ID 6159 generated in the application event log. They all started occurring after I deleted a attribute flo
-
AVi movies (MPEG-4 AVI format) suddenly won't play properly in iPhoto 6.0.5
Since updating iPhoto to v.6.0.5, all of my old AVI movies in iPhoto (taken with a CASIO Exilim digital camera and uploaded earlier to my iMac G5) show only a blank screen when played and now only play the sound that was recorded. The "thumbnails sti
-
PriorityTask ignored by version 3.6.0 but working with 3.5.3
Hello, The priority task is used for a few entry processors with Coherence 3.5.3 no longer work with 3.6.0. I get a "DEBUG ... Interrupted PartitionedCache, Thread[DistributedCache:LoaderDistributedCache,5,Cluster] " 160 seconds after my processors s
-
in the next few weeks i will be compliling a list of wireless routers or access points which dislike my e71. i repair tech gear more than my main job, and have seen a lot of rubbish devices that do not like my phone (i test with an eeepc701sd, a dell
-
Hi All I have a custom target recon job. When the job runs for the first time, recon events are created and processed, but when I run the following query, I don't see the events getting completed: select rb_key, rb_batch_status, rb_profile_name from