Re: BADI + ME21N + internal table
My task is this below using BADI...........! plz give solution for this task..
1> I will enter all the details in me21n to create Standard PO no... When i click SAVE button in me21n,
BADI should trigger &what r the details entered in the screen me21n should be moved to one internal tables... Is there any solution for this .... Plz replay me soon,,,,,,,,,,,!
Hello,
Once you save PO in ME21n transaction the following BADIs are triggered.
REFERENCE_SITE
CACL_CHARACTER_INPUT
ME_COMMTMNT_PO_RELEV
ME_COMMTMNT_PO_REL_C
ME_COMMITMENT_STO_CH
ADJUST_NET_DAYS
BUAVC_CHECK_RESTRICT
ME_INFOREC_SEND
WVKU_DETERMINE_SP
ME_CHECK_SOURCES
LFM2_DB_STRG
ADDRESS_UPDATE
ME_PURCHDOC_POSTED
EXTENSION_US_TAXES
Among these BADIs ME_PURCHDOC_POSTED is very useful. You will get the PO number and its corresponding details here.
Method is POSTED and useful parameters are
IM_EKKO(New Purchasing Document Header) , IM_EKPO(New Items)
Regards
Arindam
Edited by: Arindam Ganguly on Dec 24, 2008 5:34 AM
Similar Messages
-
How to declare internal table in BADI with variable name beginning with 0..
Gurus,
How to declare an internal table within a BADI. I have to implement a BADI UC_TASK_CUSTOM for BCS to BW load and there i have to declare an internal table like:
TYPES: BEGIN OF t_cube_data,
0cs_version TYPE /bi0/oics_version,
0sem_cgcomp TYPE /bi0/oisem_cgcomp,
bcs_vers TYPE /bic/oibcs_vers,
bcs_lcus TYPE /bic/oibcs_lcus,
bcs_ldch TYPE /bic/oibcs_ldch,
bcs_invcom TYPE /bi0/oibcs_invcom,
bcs_litem TYPE /bic/oibcs_litem,
bcs_llob TYPE /bic/oibcs_llob,
bcs_lmay TYPE /bic/oibcs_lmay,
0move_type TYPE /bi0/oimove_type,
pcompany TYPE /bi0/oipcompany,
bcs_lprg TYPE /bic/oibcs_lprg,
figlxref3 TYPE /bic/oifiglxref3,
fiscyear TYPE /bi0/oifiscyear,
fiscper3 TYPE /bi0/oifiscper3,
fiscvarnt TYPE /bi0/oifiscvarnt,
curkey_gc TYPE /bi0/oicurkey_gc,
unit TYPE /bi0/oiunit,
cs_trn_gc TYPE /bi0/oics_trn_gc,
cs_trn_qty TYPE /bi0/oics_trn_qty,
END OF t_cube_data
But with this declaration it gives a error saying that u cannot have a variable beginning with 0...like 0cs_version....
but i have to do it for my functionality to wrk...
Please help me do it....
how can i declare a internal table that allows me to have variable names that start with 0....
Please help....Its URGENT....
Thanks
SamMurali,
I need to have 0 before the variable name in the declaration of the internal table....how can i attain that....
Please suggest...
Thanks
Sam -
Hello friends,
I am working with Badi's and my requirement is i need to fetch the data from database in badi method and have to use that data in my abap program.
So, is there any way i can declare internal table as export parameter of badi method or else if I declare internal table in my abap program and export that while calling badi method then how to declare internal table as import parameter in badi method.Some things are not clear here..
1 - You have a ABAP Program that trigger's a process that calls a BADI and then return to your ABAP Program
OR
2 - You have implemented a BADI in a process that runs separately from the ABAP Program, and you need to grab data from the BADI into your Program?
I`d suggest:
1 - Try to use a static method or a static class with a method that would "hold the data" from the badi into you memory. You could use methods like SET_INT_TABLE in BADI and then GET_INT_TABLE in your ABAP Prog.
2 - Not sure why you want to do this, but use a Z table.
Regards
Edited by: Mauricio Roberto Cruz on Feb 11, 2011 2:26 PM -
Internal table in method of class (BADI)
Hello people !!
I need to use an internal table into method of class. I don´t know very well how to use it. I know that it hasn´t a header; but I don´t know how to defined and use it.
I need to use in a method of badi.-
I will be grateful by the help that your could offer to me.-
Thank you so much,
Esther.-Thank you for your answer.
But, I had defined as de fist item, but I had defined with a structure of dictinary.
Now, in my code, I need to deposit information to the above mentioned table. Then, when I try to accede to the fields of the estructure, when I compile it gives me the following mistake:
"ACC_DATA" is a table without a header line and therefore has no
component called "CUENTA".
I attach departs from the code:
types: es_accdata type standard table of Z_ES_ACCDATA.
data: acc_data type es_accdata.
loop at it_mseg into r_mseg.
si es Entrada de Mercancía
if r_mseg-bwart = '101'.
at first.
acc_data-cuenta = r_mseg-sakto.
if not r_mseg-kostl is initial.
acc_data-centro_coste = r_mseg-kostl.
else.
acc_data-orden_inversion = r_mseg-aufnr.
endif.
endat.
monto = monto + r_mseg-dmbtr.
endif.
endloop.
Thank you againg, for a new answer !!!!
bye, Esther.- -
Is there any other option for using internal table in badi
hi
i know we cannot use internal table in badi
but is der any other option
plz write in d codez too
with Regards
Rohan Shetty
Edited by: Rohan Shetty on May 6, 2008 2:14 PMof course you can use internal table in BAdi, do like this.
data: itab type table of ....
data: wa type ...
Example:
data: itab type (standard, sorted, hashed) table of mara.
data: wa type mara.
Or create your own type within the badi.
types: begin of ty_xxx,
fielda type c,
fieldb type n,
fieldc type d.
types: end of ty_xxx
data: itab type table of ty_xxx.
data: wa type ty_xxx.
Edited by: Micky Oestreich on May 6, 2008 2:16 PM -
Accessing internal table declared outside of BAdI implementation
I am working on a BAdI implementation and within the BAdI, I need to manipulate the data of an internal table that is declared in the calling routine. This internal table is not a parameter to the BAdI call. I am wondering is there a way to access the internal table that is not recognized by the BAdI implementation? If so, what's the syntax to do this?
I know in debug mode, I am able to access the content of the internal table by using (Program)Itab. But I get a syntax error when accessing the internal table using (Program)Itab syntax.
Any help is appreciated!Thanks, Max.
I tried your method, but I am getting a short dump due to type conflict. I think it's because the internal table I'd like to access is declared using the following syntax:
data: begin of itab occurs 0,
end of itab.
Therefore, when processing the assign statement, the field-symbol is being treated as a structure...
I tried to change the field-symbol type to any, but after that, I can't modify the table content using loop at type of syntax..
Do you have any other suggestions?
Thanks very much! -
BADI cant use an internal table with header line
hi,
In BADI, we cant use an internal table with header line, and I am calling a function module which requires internal table as import parameter, now, the table I am passing is without a header line, So how to solve this problem ?You can use a type and then create an internal table of that type.
types :
begin of t_<example>
*field list
end of t_<example>
data :
gt_<table> type standard table of t_<example>
pass this to the FM -
ABAP MM: In ME21N which internal table holds Actual Price (Including Taxes)
Using tcode ME21N, while creating new PO, which internal table holds Actual price (Including Taxes) of whole PO (not by item) , assuming PO is not saved.
In the program, I want to capture the total cost of whole PO including taxes as soon as user enter the items. So that I can make some processing according to the total amount of PO.
Thanks,Check the internal table lt_mepoaccounts field netpr.
-
Passing an internal table to a badi
Helo All,
I have declared a variable outside the badi say
data: phead like STRUCTURE_head occurs 0 with HEADER LINE.
suppose this phead contains say 4 rows .
calling the method of the badi .
CALL METHOD user_exit->method1
CHANGING
thead = phead .
Here the parameter thead is of the type structure , so only the header line is passed . How do i pass all the four rows to the badi ?
Thanks in advance
regards,
swethaHi Swetha,
Let say, we have an internal table phead.
You will be declaring a work area, lets say whead.
now,
LOOP AT phead into whead.
BADI CALL.
changing
thead = whead.
ENDLOOP.
So, whead wil be passed as changing parameter to the badi...
to be precise, you will be passing the structure to the badi.
Best Regards,
Ram. -
I have a requirement to create and implement Badi.
The following is code:
method IF_EX_NOTIF_EVENT_SAVE~CHANGE_DATA_AT_SAVE.
DATA: l_progname TYPE sy-repid,
l_dynnum TYPE sy-dynnr.
types: BEGIN of itab.
INCLUDE dynpread.
types: END of itab.
data: dynpread_tab like table of itab.
l_progname = sy-repid.
l_dynnum = sy-dynnr.
CLEAR dynpread_tab.
REFRESH dynpread_tab.
dynpread_tab-fieldname = 'ZZACNUM'.
APPEND dynpread_tab.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
DYNAME = l_progname
DYNUMB = l_dynnum
TRANSLATE_TO_UPPER = ' '
REQUEST = ' '
PERFORM_CONVERSION_EXITS = ' '
PERFORM_INPUT_CONVERSION = ' '
DETERMINE_LOOP_INDEX = ' '
START_SEARCH_IN_CURRENT_SCREEN = ' '
START_SEARCH_IN_MAIN_SCREEN = ' '
START_SEARCH_IN_STACKED_SCREEN = ' '
START_SEARCH_ON_SCR_STACKPOS = ' '
SEARCH_OWN_SUBSCREENS_FIRST = ' '
SEARCHPATH_OF_SUBSCREEN_AREAS = ' '
TABLES
DYNPFIELDS = dynpread_tab
EXCEPTIONS
INVALID_ABAPWORKAREA = 1
INVALID_DYNPROFIELD = 2
INVALID_DYNPRONAME = 3
INVALID_DYNPRONUMMER = 4
INVALID_REQUEST = 5
NO_FIELDDESCRIPTION = 6
INVALID_PARAMETER = 7
UNDEFIND_ERROR = 8
DOUBLE_CONVERSION = 9
STEPL_NOT_FOUND = 10
OTHERS = 11
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
IF sy-subrc = 0.
LOOP AT dynpread_tab.
ENDLOOP.
ENDIF.
endmethod.
It is giving me error: INCLUDE report "DYNPREAD" not found.
Any idea?
Thanks in advance.Hi
U should remember the internal table is without header line:
DATA: l_progname TYPE sy-repid,
l_dynnum TYPE sy-dynnr.
*types: BEGIN of itab.
*INCLUDE dynpread.
*types: END of itab.
*data: dynpread_tab like table of itab.
DATA: dynpread_tab TYPE TABLE OF DYNPREAD.
DATA: dynpread_wa TYPE DYNPREAD.
*dynpread_tab-fieldname = 'ZZACNUM'.
*APPEND dynpread_tab.
dynpread_wa-fieldname = 'ZZACNUM'.
APPEND dynpread_wa to dynpread_tab.
CALL FUNCTION 'DYNP_VALUES_READ'
IF SY-SUBRC = 0.
* LOOP AT dynpread_tab.
*ENDLOOP.
LOOP AT dynpread_tab into .
ENDLOOP. -
Experts,
While doing IR in MIRO , i have entered a PO no . then the Line Items under this PO are getting displayed.in PO Reference Tab. Suppose there are 3 line Items . But i want to do IR for only 2 line items (whose Quality Inspection has been done).
In debugging am unable to find in which Internal Table of which std / Include program , the two selected records have been stored before the 'Simulate Tab' is pressed .
Please help .
Thanks in Advance
Jack1-Check this BADI INVOICE_UPDATE
method is CHANGE_AT_SAVE
2-You can also look into MM08R002 and FM EXIT_SAPLMR1M_001 .
Lets see if it is helpful.
Neha -
Select on MARA resulting into # values in internal table for one field
Hi Team,
I have written a SELECT statement on MARA table as below.
TRY.
SELECT matnr zzwftag FROM mara CLIENT SPECIFIED
INTO CORRESPONDING FIELDS OF TABLE gt_mara WHERE
mandt = sy-mandt AND
zzwftag NE space
AND zzwftag IS NOT NULL
AND zzwftag NE '#'
AND zzwftag NE '%#%'
AND zzwftag NE ' '
AND zzwftag NOT LIKE '%/%'(012).
CATCH cx_sy_dynamic_osql_error.
MESSAGE 'Error While Fetching Data from MARA'(044) TYPE 'S'(040) DISPLAY LIKE 'W'(041).
ENDTRY.
IF NOT gt_mara[] IS INITIAL.
DELETE gt_mara[] WHERE zzwftag EQ '#'
OR zzwftag IS INITIAL
OR zzwftag EQ space
OR zzwftag EQ ' '.
ENDIF.
Observations: 1. In
the resulting internal table I am seeing '#' values for fields zzwftag which are actually empty when I see the record in SE11 in MARA(ALV display). It shows '#' in it in SE16 display(We can choose User parameters and hence mode of display in SE11)
The requirement is to avoid those records where zzwftag is initial i.e. blank. I tried to delete invalid records but to no avail.
Please suggest any way where I can get the Select correct.
Regards,
AmitPlease do not use so many not conditions in one query....
Using so many negative conditions results in bad data.
Instead use delete statements later this would not confuse the system.
Also if you are using sy-mandt then i think you should not use client specified system will take care of it.
TRY.
SELECT matnr zzwftag FROM mara CLIENT SPECIFIED
INTO CORRESPONDING FIELDS OF TABLE gt_mara WHERE
mandt = sy-mandt AND
zzwftag NE space.
CATCH cx_sy_dynamic_osql_error.
MESSAGE 'Error While Fetching Data from MARA'(044) TYPE 'S'(040) DISPLAY LIKE 'W'(041).
ENDTRY.
IF NOT gt_mara[] IS INITIAL.
DELETE gt_mara[] WHERE zzwftag EQ '#'
OR zzwftag IS INITIAL
OR zzwftag EQ space
OR zzwftag EQ ' '.
delete gt_mara[] where zzwflag eq '%#%'.
ENDIF. -
How to save Internal table inside Personnel Change Request after JSPcode ??
HI ,
I have built up Som Org management Data while running PCR . But when it goes to JSP for form display
and comes back to SAP. The internal table that I have saved in SAP MEMORY / ABAP MEMORY is getting washed off..
I m building the table in the INIT method of the BADI ( qisr1) .
Can any body suggest a way for saving the DATA when control is back from JSP.
is it posible thr saving in som class private data ??SAP and ABAP Memory belong to a user session, in a new session you wont have access to the ABAP/SAP Memory of another session. Seems like you are using a stateless JSP.
Instead you could use the Shared Memory, check this link: http://help.sap.com/saphelp_nw04s/helpdata/en/14/dafc3e9d3b6927e10000000a114084/frameset.htm or you use a Server-Side cookie, http://help.sap.com/saphelp_nw70/helpdata/EN/bd/4cd23a09313b37e10000000a11405a/frameset.htm
regards,
Markus -
Hi guys...
How can I import a internal table in a method of Badi?
For example:
I have the itab_ekpo that I export to memory in a especific program and need to import this table.
Hw can I do this in a method ?
tks
flavioHi,
If the table data is filled in same session and BADI is called is in same session then you use simple EXPORT TO MEMORY-ID and IMPORT TO MEMORY-ID statement.
Else if both are done in different session then use EXPORT using INDX table and IMPORT the DATABASE INDX in your BADI.
Please see the F1 documentation for the keyword help.
Regards,
SRinivas -
Records need to be passed between Internal tables
Hi Experts,
I'm working in BADI and have three internal tables say IT1, IT2 and IT3 where BELNR is the key field for all the tables. Now I have a field RECEIPT from IT1.
My requirement is, I want to fetch only those records where IT1-RECEIPTS = X and then need to pass only these records to IT2 and IT3.
Is there any possibility to pass the records between internal tables. Please clarify me as how can I achieve it.
BR,
RAM.Hello,
DATA: wa_tab LIKE LINE OF it1.
LOOP AT it1 INTO wa_tab WHERE RECEIPTS EQ 'X'.
APPEND wa_tab to it2.
APPEND wa_tab to it3.
ENDLOOP.
Maybe you are looking for
-
If I turn on my Xbox before turning on my tv, the tv stops functioning and the screen is black and won't even let me change the input settings. I have to take out the HDMI cable, turn the tv off, then turn the tv back on, manage to put back the cable
-
IPad 4th gen won't charge?
I have recently got an iPad 4th gen (3 with lightning charger). Last night I was on youtube watching videos, when suddenly the screen went black. I plugged it into the wall, pressed the on switch.. it turned on and it was 1%. So I let it charge overn
-
CALL_FUNCTION_NOT_ACTIVE when login
Hi experts: I got a deadly error when I login SAP. When I using t-code=SPAM to add patches of sap(the patch is SAPKB62036), the network was cut off with my incautious, now there is a deadly error when I login SAP: ABAP/4 runtime error Error code CALL
-
Here is my problem. Just a few days ago everything worked well on my macbook pro, but since some, to me, unknown event i lost capability to import photos form mass storage devices - CF cards connected via card reader. This problem affects booth Photo
-
Just installed. Now can't open many Word for Mac files. How fix?
I just installed Snow Leopard. Now I find I have many Word documents in file folders that I can double click on, but they won't open. Even when I try other ways to open, they won't. I have a big need for a quick fix. Any suggestions? Thanks! Duncan