BAdI - AC_DOCUMENT / data passing for nested structures
Hi all.
I need your help for this scenario:
I used this to pass value of MM field to FI field from transaction MIGO.
Our company placed field in EKKN-WEMPF to BSEG-ZUONR.
For this one option was: BAdI AC_DOCUMENT
Questions:
1. Nested structures - passing of data:
First problem encountered was with the reading of data from nested structures and passing them to nested structures as well. How to do this? I have used a certain declaration but any input will be much appreciated.
2. When I activated my BAdI, it says error on FI Interface,
specifically on AWREF and AWORG fields.
It is currently blank. Can I use the values in IM_DOCUMENT to pass to EX_DOCUMENT?
(What is a good way to do it since simple syntax does not allow for passing of data bec. structures are incompatible, and added complexity, it has nested structures.)
If you have sample code for this, it would truly be helpful.
Thanks and God bless!
Hi,
Check that for which condition the message is triggering.
Try to check the condition.
Regards
Sandipan
Similar Messages
-
Query on Receiver FCC for nested structure
Hi Friends,
I want to configure the Receiver side FCC for the below nested structure.
Can you guide me how can i achicve it? or its not possible for nested structure?
Seg100,Seg200.Seg300 and Seg400 are nested one below the other.
<?xml version="1.0" encoding="UTF-8" ?>
- <ns0:Test xmlns:ns0="http://hello.com">
--<Seg100>
--<field1>0000564.30</field1>
--<field2>KG</field2>
--<Seg200>
---<field3>1070</field3>
---<Seg300>
<field4>5</field4>
<Seg400>
<field4>5</field4>
</Seg400>
---</Seg300>
--</Seg200>
-</Seg100>
</ns0:Test>
Regards
VenkateshHi,
For nested structure we cont do the File content conversion.
so that we need to convert it a flat structure in the mapping level and then we can go for FCC.
Regards,
Prakasu -
Date fields for info structure S032 are not generated
Hi Experts,
I am trying to update set up tables for '02' using OLI2BW. I excluded some plants from selection and executed the set up. But the job run for few mins and completed with the message "Date fields for info structure S032 are not generated".
I couldn't see any records in RSA3.
Please through some light on this issue.
Points reward for usefull help.
Please no wild guess.
Regards,
-N-Did you find out why. I am getting same message.
Thanks
Shalini -
Fill internal table with mutliple entries for nested structure
Dear ABAP Experts,
I have a question related to fill internal tables with nested structures.
I have a structure like this:
BEGIN OF proto,
sicht TYPE ysicht,
version TYPE FAGLFLEXA-RVERS,
BEGIN OF kons,
kon TYPE YKONSEINHEIT,
END OF kons,
jahr TYPE CHAR04,
END OF proto.
Now I need to fill this structure with values (over an internal table), but how can I achieve that I save multiple datas für element "kon" für one single entry of structure "proto"?
An example could be:
sicht = '01'
version = '100'
kon = 1001 (first entry)
kon = 1002 (second entry)
usw... (n entry)
jahr = '2008'
Thanks in advance for every helpful answer.
Regards
ThomasBEGIN OF proto,
sicht TYPE ysicht,
version TYPE FAGLFLEXA-RVERS,
kons TYPE STANDARD TABLE OF YKONSEINHEIT WITH NON-UNIQUE KEY TABLE_LINE,
jahr TYPE CHAR04,
END OF proto.
DATA: ls_proto TYPE proto,
lt_proto TYPE STANDARD TABLE OF proto,
ls_kon
ls_proto-sicht = '01'.
ls_proto-version = '100'
INSERT '1001' INTO TABLE ls_proto-kons.
INSERT '1002' INTO TABLE ls_proto-kons.
ls_proto-jahr = '2008'.
INSERT ls_proto INTO TABLE lt_proto
If you're going to use a more complicated inner table with several components, then you need to define a type for those components.
matt -
HRFORM - difference between Flat Staructure & Nested Structure
Hi,
I wish to know the dfifference between deciding nested structure or flat structure in tcode HRFORMS. I have to work on form SAP_PAYSLIP_CA which is a nested structure. I have read that working on flat structure is far easier than working on nested structure. I wish to know what fields i have to add to convert this to flat structure. If i have to work on this nested structure what code i have to add in my interface (e.g. loop at.... for nested structure) for working on employee data. Also i wish to know how can i pull non key field data in my program.
I nee dthe inputs very urgently.
Thanks in advance.
AjayHi Ajay,
Please check the link
http://help.sap.com/saphelp_dimp50/helpdata/en/c5/d69f5b6ccb11d3968b00a0c9306433/content.htm
This is will partially answer your Query.
Regards
JwaliniS -
Input for nested data structure service
I plan to use a service which require some header-information and additional 1...n item-information.
The data structure of this service is nested, means there is only one input-port for the header AND the nested items.
Is it somehow possible to create a UI consists of two inputs like one input form for the header and one input table for the items on the inputport??
The main problem is that either the header or the item information is transported to the input port of the service, never both as required by the service. Tried to solve it using a data bridge (or as it called in Ehp1 for 7.1 "data share") without any success.
Solved it by myself Just forgot to check "Control Buttons" in the Configure tab of the table.
Edited by: Stefan Witschel on Nov 18, 2008 1:47 PMYes, I still used it.
In Ehp1 is a feature that automatically add a data share if you drag and drop the input port of your servce with nested structure anywhere on the screen. On this data share you can add another input form or table for the nested elements. Both forms/tables than are connected at the input with the share.
Finally you do the data mapping for the nested structure and define an action to call this connection.
Actually my problem was that I couldn't input data in rows of a table for the nested structure. I solved it by enabling the table controls which allows you to add an delete rows. -
Badi AC_DOCUMENT for updating prctr
Hi ,
I am trying to update the profit center ( prctr ) through the BADI AC_DOCUMENT.
I have written the below code but its not posting and is giving me an error that document saved but not posted . Below is the code
In the variable I am passing the profit center which I am getting from Z table
DATA: ex_item type ACCIT,
wa_ex_item type ACCIT_SUB.
LOOP AT im_document-item INTO ex_item.
wa_ex_item-mandt = ex_item-mandt.
wa_ex_item-awtyp = ex_item-awtyp.
wa_ex_item-awref = ex_item-awref.
wa_ex_item-aworg = ex_item-aworg.
wa_ex_item-posnr = ex_item-posnr.
wa_ex_item-prctr = l_prctr.
APPEND wa_ex_item to ex_document-item.
endloop.Hi,
Check that for which condition the message is triggering.
Try to check the condition.
Regards
Sandipan -
Hi Experts/Gurus,
I had a problem when i am passing the ct_extension data to ct_text. I need to pass the data of two new fields created in order jsp as extension data. For this i used the BADI method "changehead_before_order" and i had passed this extensoin data from ct_extension to ct_text which can be passed to crm_order_maintain before order. And when i try to get the data using the method gethead_get_data, in this iam calling CRM_ORDER_READ to get the values of IT_TEXT, the b2b webshop is giving an error and asking to logon again.
The below is the code which i have written in both the methods:
METHOD if_ex_crm_isa_basket_head~changehead_before_order.
DATA : ls_orderadm_h TYPE LINE OF crmt_orderadm_h_comt,
wa_orderadm_h TYPE LINE OF crmt_orderadm_h_comt,
ls_extension TYPE crmt_isales_extension,
wa_extension TYPE crmt_isales_extension,
ls_text TYPE crmt_text_comt,
ls_lines TYPE comt_text_lines_t,
wa_lines LIKE LINE OF ls_lines,
wa_text LIKE LINE OF ls_text,
READ TABLE it_extension INTO wa_extension WITH KEY name = 'ZEXTNSM'.
wa_text-ref_guid = wa_extension-ref_guid.
* wa_text-tdobject = 'CRM_ORDERH'.
* wa_text-tdname = wa_extension-ref_guid.
wa_text-tdid = '0001'.
wa_lines-tdline = wa_extension-value.
APPEND wa_lines TO ls_lines.
wa_text-lines = ls_lines.
INSERT wa_text INTO TABLE ct_text.
CLEAR wa_text.
CLEAR wa_lines.
CLEAR ls_lines.
READ TABLE it_extension INTO wa_extension WITH KEY name = 'ZEXTNSI'.
wa_text-ref_guid = wa_extension-ref_guid.
wa_text-tdid = '0002'.
wa_lines-tdline = wa_extension-value.
APPEND wa_lines TO ls_lines.
wa_text-lines = ls_lines.
INSERT wa_text INTO TABLE ct_text.
* ct_text = ls_text.
* append ls_text to CT_TEXT.
ENDMETHOD.
to get the data :
METHOD if_ex_crm_isa_basket_head~gethead_get_data.
DATA : ls_extension TYPE crmt_isales_extension,
ls_text TYPE crmt_text_comt,
wa_text type CRMT_TEXT_COM,
ls_lines TYPE comt_text_lines_t ,
wa_lines type TLINE,
ls_basket_head TYPE crmt_isales_baskethead_ui,
lv_objectid type CRMT_OBJECT_ID.
lv_objectid = cs_basket_head-OBJECT_ID.
if lv_objectid is not initial.
CALL FUNCTION 'CRM_ORDER_READ'
EXPORTING
it_header_guid = cs_basket_head-guid
IMPORTING
et_text = ls_text.
READ TABLE ls_text INTO wa_text WITH KEY tdid = 'ZSM'.
*Appending the discount value from the database.
ls_extension-ref_guid = cs_basket_head-guid.
ls_extension-name = 'ZEXTNSM'.
ls_lines[] = wa_text-lines[].
READ TABLE ls_lines INTO wa_lines INDEX 0.
ls_extension-value = wa_lines-TDLINE.
APPEND ls_extension TO ct_extension.
CLEAR ls_extension.
endif.
ENDMETHOD.
When i put the external break point and checked, in the webshop when i click the update button, in the method changehead_before_order, in the ct_extension table i am getting the values and keys which i have set in the java action. But when i click "order" button, i am not getting anything in ct_extension table which i cannot in turn pass this values to ct_text.
Can you please help me in this regard??
Thanks a lot in Advance!
Regards,
Lakshman.The header guid i am trying to pass to the crm_order_read is a mismatch.
-
Hi,
I'm getting an error "FATAL RUN-TIME ERROR: Out-of-bounds pointer argument (before start of memory block)" while trying to access a data element from a nested structure (structure with in a structure) in a dll file in debug as well as release mode.
I'm using CVI 12.0, and i came across some messages in the forum stating that similar erros was there for CVI 8.0, 8.5 & 9.0 but not 8.1. posted message
A previous Message posted some time back clearly explains the issue for CVI 9.0, but i don't know whether the isuue still persists for CVI12.0 too.
Will be helpful if somebody can throw some light regarding the above mentioned issue;
Thanks.Dosth wrote:
i don't know whether the isuue still persists for CVI12.0 too.
As you can see here this issue has been fixed in CVI 9.0.1 -
Trigger event for badi ac_document
Hello,
I want to use BADI AC_DOCUMENT for text substitution following the note 386896. I create a new implementation but when I create a new FI Document the BADI is not triggered correctly.
How can I know where the BADI is called in ABAP program ?
Thanks for your help.Hi,
Check that for which condition the message is triggering.
Try to check the condition.
Regards
Sandipan -
Dynamically create data type for structure
Hello Experts.
how to create dynamic data type for structres. for example.
data lv_struc_name type strukname.
lv_struc_name = get_struct_name( ) ****** this method gives the structure name('ct_struc')
now I want to create one data type, which is having the type of lv_struc_name content.(ct_struct)
thanks
TimHi,
here is the link to really good presentation about generic programming ABAP351.
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/b332e090-0201-0010-bdbd-b735e96fe0ae
It contains examples how to create dynamic structure and tables.
Cheers -
Assigning structure of data screen for users
Hi,
I want to know where is the setting for material master data screens , how to find out the which data strucutre is assign , we have three plant e.g : 1,2,3 , for all those three plant we are using mat. type FERT , but sctrucutre of data screen is different for all three plant I want to find where this assignment is done and how to find it.
regards,
zafarHI,
U can check here,
Option-1:*Select Screen Sequence 21 instead of B2 & copy 21 and rename it( in step 5)[if u do not want Excise Data] Note: Follow the steps for customization of material master 1. Material Number: SPRO -> Logistic - General -> Material Master -> Basic Settings -> Define Output Format of Material Number TCODE: OMSL 2. Define Field Reference: SPRO -> Logistic - General -> Material Master -> Field Selection -> Maintain field Selection For data Screens T CODE: OMS9 3. Define Industry Sector: SPRO -> Logistic - General -> Material Master -> Field Selection -> Define industry Sectors and industry -sector- specific Field Selection T.Code:OMS3 4. Material Type: SPRO -> Logistic - General -> Material Master -> Basic Settings -> Material Type ->Define attribute of material Type T.Code:OMS2 (Select Material Type: ROH for ur raw material( example) copy it and renamed it to UR RAW MATERIAL) 5. Define Screen Sequence: SPRO -> Logistic - General -> Material Master -> Configuring the Material Master -> Define structure of Data Screens for each Screen Sequence T.Code:OMT3B (Select Screen Sequence: 21, copy it and renamed it to Z with any letter( Like ZA or ZB ) 6. Ordering Screen Sequence: SPRO -> Logistic - General -> Material Master -> Configuring the Material Master -> Maintain Order of main and Additional Screen T.Code:OMT3R 7. Assign Screen Sequence to Industry Sector: SPRO -> Logistic - General -> Material Master -> Configuring the Material Master -> Assign Screen Sequences to User/Material Type/Truncation/Industry Sector T.Code:OMT3E 8. Assign Field Reference to Plant: SPRO -> Logistic - General ->Material Master -> Field Selection -> Define Plant -Specific Field Selection and Plant -Specific Screen Selection T.Code:OMSA 9. Define Material Group SPRO -> Logistic - General -> Material Master -> Setting for Key Field -> Define Material Group T.Code:OMSF 10. Define Number Range of Material: SPRO -> Logistic - General -> Material Master -> Basic Settings -> Material Type ->Define Number Range for each Material Type T.Code:MMNR 11. Define Purchasing Group: SPRO -> Material Management->Purchasing->Create Purchasing Group T.Code:OME4 Fore more check the Link http://www.sap123.com/showthread.php?t=27 Option-2:Try this 1.Just click the tab ,(Which is u want to delete/Hide )and get the field name 2.Go to T.Code: OMSR and enter that field name and get Selection Group 3.1. Use t.Code: OMS2 and click your material type and in next screen check Field reference ( you have assigned for material type){{ ( example :;For ROH material type the Field reference is ROH) 3.2. use T.code:OMS9,, Double Click your Field Reference and select field selection Group & select round box of Hide
Regards
KK
Edited by: Kishore Kumar Galla on Mar 26, 2010 5:22 PM -
Which BADI will be triigrd for dates in service contract creating
Hello CRM guys ,
Which BADI will be triigrd for dates in service contract creating.
regards,
ram.Hello CRM guys ,
Which BADI will be triigrd for dates in service contract creating.
regards,
ram. -
File sender adapter: Content conversion for very deep nested structure
Hi all
I have a file which looks like this
HDOCKET 9800000660980000061911062009AA123456bbWM100012349800000619
DDOCKET_TEST001 4012YAG1
WZOA00000000010000000001
WZOA00000000020000000002
WZOB00000000030000000003
IAAXX000001
IAAXX000002
C0000000000000000000100000000000000000001000000000000000000020000000000000000000300000000000000000004
T2
and my structure is
Header - 1
Detail - 0....Unbounded
Bag - 0.....Unbounded (sub node of detail)
Track - 0.....Unbounded (sub node of detail)
Customer - 0.....Unbounded (sub node of detail)
Trailer - 1
and in the file sender adapter i mentioned the following content conversion setting
HEADER,1,DETAIL,*,Bag,*,Track,*,Customer,*,TRAILER,*
But when i go and see in the monitoring i received the following conversion
<?xml version="1.0" encoding="utf-8" ?>
<ns:MT_REQ xmlns:ns="http://royalmail.com/dd_c">
<HEADER>
<ID>H</ID>
<INT>DD</INT>
<CAR>9899999660</CAR>
<CUS>9899999619</CUS>
<POST>11062009</POST>
<NUMBER>AA123456bbWM10001234</NUMBER>
<ACC>9899999619</ACC>
</HEADER>
<DETAIL>
<ID>D</ID>
<Bag>DOCKET_TEST001</Bag>
<S>4012</S>
<Code>YAG</Code>
<mat>1</mat>
<count/>
<Mixed />
</DETAIL>
<Bag>
<ID>W</ID>
<Zone>ZOA</Zone>
<Item>0000000001</Item>
<Number>0000000001</Number>
</Bag>
<Bag>
<ID>W</ID>
<Zone>ZOA</Zone>
<Item>0000000001</Item>
<Number>0000000001</Number>
</Bag>
<Bag>
<ID>W</ID>
<Zone>ZOA</Zone>
<Item>0000000001</Item>
<Number>0000000001</Number>
</Bag>
</Bag>
<Track>
<ID>I</ID>
<Item>AAXX000001</Item>
</Track>
<Track>
<ID>I</ID>
<Item>AAXX000001</Item>
</Tracked>
<Customer>
<ID>C</ID>
<OrigCustomer>00000000000000000001</OrigCustomer>
<Field1>00000000000000000001</Field1>
<Field2>00000000000000000002</Field2>
<Field3>00000000000000000003</Field3>
<Field4>00000000000000000004</Field4>
</Customer>
<TRAILER>
<ID>T</ID>
<Count>2</Count>
</TRAILER>
</ns:MT_REQ>
whereas i wanted it like:
<?xml version="1.0" encoding="utf-8" ?>
<ns:MT_REQ xmlns:ns="http://royalmail.com/dd_c">
<HEADER>
<ID>H</ID>
<INT>DD</INT>
<CAR>9899999660</CAR>
<CUS>9899999619</CUS>
<POST>11062009</POST>
<NUMBER>AA123456bbWM10001234</NUMBER>
<ACC>9899999619</ACC>
</HEADER>
<DETAIL>
<ID>D</ID>
<Bag>DD_TEST001</Bag>
<S>4012</S>
<Code>egg</Code>
<mat>1</mat>
<count/>
<Mixed />
<Bag>
<ID>W</ID>
<Zone>zzz</Zone>
<Item>0000000001</Item>
<Number>0000000001</Number>
</Bag>
<Bag>
<ID>W</ID>
<Zone>zzz</Zone>
<Item>0000000001</Item>
<Number>0000000001</Number>
</Bag>
<Bag>
<ID>W</ID>
<Zone>zzz</Zone>
<Item>0000000001</Item>
<Number>0000000001</Number>
</Bag>
</Bag>
<Track>
<ID>I</ID>
<Item>AAXX000001</Item>
</Track>
<Track>
<ID>I</ID>
<Item>AAXX000001</Item>
</Tracked>
<Customer>
<ID>C</ID>
<OrigCustomer>00000000000000000001</OrigCustomer>
<Field1>00000000000000000001</Field1>
<Field2>00000000000000000002</Field2>
<Field3>00000000000000000003</Field3>
<Field4>00000000000000000004</Field4>
</Customer>
</DETAIL>
<DETAIL>
<ID>D</ID>
<Bag>DD_TEST002</Bag>
<S>4012</S>
<Code>egg</Code>
<mat>1</mat>
<count/>
<Mixed />
<Bag>
<ID>W</ID>
<Zone>zzzzzz</Zone>
<Item>0000000001</Item>
<Number>0000000001</Number>
</Bag>
<Bag>
<ID>W</ID>
<Zone>ZOA</Zone>
<Item>0000000001</Item>
<Number>0000000001</Number>
</Bag>
<Bag>
<ID>W</ID>
<Zone>zzz</Zone>
<Item>0000000001</Item>
<Number>0000000001</Number>
</Bag>
</Bag>
<Track>
<ID>I</ID>
<Item>AAXX000001</Item>
</Track>
<Track>
<ID>I</ID>
<Item>AAXX000001</Item>
</Tracked>
<Customer>
<ID>C</ID>
<OrigCustomer>00000000000000000001</OrigCustomer>
<Field1>00000000000000000001</Field1>
<Field2>00000000000000000002</Field2>
<Field3>00000000000000000003</Field3>
<Field4>00000000000000000004</Field4>
</Customer>
</DETAIL>
<TRAILER>
<ID>T</ID>
<Count>2</Count>
</TRAILER>
</ns:MT_REQ>
i.e. i need all Bag ,Track and Customer inside detail tag.
could anyone help me in this..i've already searched SDN and got some link as useful but none of them were totally related.
Regards
NainaNaina
Pls. check my forum link, i had the single level hierarchy XML file which I converted into nested structure & then into flat file.
File Conversion in Rec File Adapter with subnodes
This can give you an idea how to go ahead. Let me know in case you need any more info about this. -
Dynamic passing of the structure in LVC_FIELDCATALOG_MERGE
Hi ABAP Gurus,
I'am doing report to read cluster results
My requirement is :
The report uses LDB -PNP in the selection screen in addition to that Clusterid is passed and what ever cluster id we select for the pernr that cluSter id results has to show in the report output
The report has to dynamically change in the output (whole structure of the cluster id) how to pass in selected cluster id (what we selected in the selection screen) in the function module
LVC_FIELDCATALOG_MERGE
Importing
I_STRUCTURE_NAME - (HERE I WANT TO GET THE STRUCTURE OF THE SELECTED CLUSTER ID IN THE SELECTION SCREEN)
Thanks and Regards,
Deepthi.Recently I have been working on generic cluster access and I must say the task was challenging. What I've discovered is:
- generic access as per cluster ID is impossible via [IMPORT ... FROM DATABASE...|http://help.sap.com/abapdocu_70/en/ABAPIMPORT_SHORTREF.htm] -> in order to create a fully flexible access you would have to go for pure dynamic program generation by means of [GENERATE SUBROUTINE POOL|http://help.sap.com/abapdocu_70/en/ABAPGENERATE_SHORTREF.htm]
- as there are houndreds of available cluster IDs it is very difficult to determine those relevant to particular employee. For just one table PCL2 there are multiple of unknown to me areas which are hard to distinguish from those (un)relevant to employee. First look at fixed values from domain RELID_PCL2 gives the feeling what we are struggling with.
- focusing on all common clusters (only from PCL2) like CU, RX, ZL, B2, PS, PT can narrow the search result but still is a lot to be handled by one program
- eventually looking deeper only on RX and possibly B2 areas seemed to be the best choice (as mostly we use only those - at least I do). So I focused on this area as generic payroll result can be easily extracted. What I needed was extracting relid for given EE molga, then py result type for this relid, the simply using FM PYXX_READ_PAYROLL_RESULT to access py results itself for given cluster directory entry (table hrpy_rgdir )
- the final challenge was how to show the results in user friendly form. As the result table I had was not only nested but deep too it wasn't so obvious. Luckily to me I was using Web Dynpro which allows to create table popins (showing the table within the table) but I don't think there is corresponding GUI control in SAP GUI. So considering how you want to show this data is really not an easy thing to do.
- As for the structure of payroll result itself (or rather structure of each of its components) can be delivered using RTTI but you will also sweat a bit before getting that done.
To conclude. There is no easy way of accessing clusters by just giving its RELID Even though you would focus on some specific part, it will take you more time then you expect at the beggining. So I would try to suppress the tempation for a moment and consider all these discussed (and those which I didn't think of) aspects.
Regards
Marcin
Maybe you are looking for
-
How to know the type of mobile?
how to get the type of mobile model mean under nokia asha 308(rm 352/ rm 838) which model i have when i am buying this mobile .no option to check the *#0000# option then how to get this..
-
ive tried to reset my ipod 120gb and its saying that format F needs to be reset ,but my laptop is saying its unable to do this.Anybody help!
-
Delete unwanted company code, like sample company codes
Hi Expert, I would like to have advice on deleting unwanted company codes, for example, country sample company codes. I would like to have remaining company code of 0001, and my client company code, say 1000, only. Is it enough to delete these unwant
-
Can I use iPad Air purchased in the US in Japan?
Hello, I'm currently assisting a team of Japanese Engineers from Japan, who are here for less than 1 year project in the US. Yesterday, my manager asked me to research & find SIM Free iPad Air to buy, but not with any carrier contract, and get a SIM
-
Error message on my mac os x stating wrong firefox address
I have reloaded firefox but when I click on the icon it keeps leading me to www.,.com. I have tried to change the address on the address bar, but it won't open the website.