Regarding BAPI Return Table
Hi all,
I am having an issues, when the user enters the correct value into an input field then i am getting the output properly. But if he enters any wrong value a message is populated into the BAPI return table. So how do I check if the BAPI return table is empty or not. If it is empty then it has to open the output table and if it is not empty it has to show the error message as an pop-up or table format.
Please reply, points will be rewarded.
Thanks & Regards,
M.Ramana Murthy
Hi Ramana,
If you want to capture the message returning from the BAPI which you are using then do the following:
1.> Drag the line from the BAPI return port and link it to a form or to a table.
2.> Then go to the form/table click the UIelement and in properties of that assign the default value which you want to display. It may be a message coming out of the BAPI.Through this way you can capture the values coming out of the BAPI
Regards,
Nutan
Similar Messages
-
Regarding BAPI Return Parameter.
Hi All,
I want to create Bapi Return Message with Variable values like : ' Sales Order 1876738267 is not created, please try again.' and want to create a log of this after BAPI calling in Calling FM. How can I do this. Please guide me.
Thanks in Advance.Hi,
CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT1'
EXPORTING
ORDER_HEADER_IN = sd_header
WITHOUT_COMMIT = ' '
CONVERT_PARVW_AUART = ' '
IMPORTING
SALESDOCUMENT = sd_doc_num
SOLD_TO_PARTY =
SHIP_TO_PARTY =
BILLING_PARTY =
RETURN = return_it
TABLES
ORDER_ITEMS_IN = itemin_it
ORDER_PARTNERS = partnr_it
ORDER_ITEMS_OUT =
ORDER_CFGS_REF =
ORDER_CFGS_INST =
ORDER_CFGS_PART_OF =
ORDER_CFGS_VALUE =
ORDER_CCARD =
ORDER_CFGS_BLOB =
ORDER_SCHEDULE_EX =
WRITE : / 'sy-subrc = ' , SY-SUBRC.
IF NOT SD_DOC_Num IS INITIAL.
WRITE : / 'Sales Order ' , SD_DOC_Num, 'Created'.
ELSE.
WRITE : / 'incorrect'.
WRITE : / RETURN_it-TYPE , RETURN_it-MESSAGE.
WRITE : / RETURN_it-LOG_NO, RETURN_it-LOG_MSG_NO,
RETURN_it-MESSAGE_V1.
ENDIF.
Hope this helps you.
Thanks,
Ruthra -
URGENT--Converting the BAPI return structure to XML
Hi,
I need to convert the return structure(export parameter) from a BAPI call to XML but not able to make out how to do that.
Before this I was required to convert the BAPI return table(export table) to XML and I did that by first converting it to the AdoDataTable, added it to a dataset and then used the builtin function to return the dataset in XML format. But here I am not able to make out how can I do the same with the Export structure.
Any help would be appreciated.
You may also mail on [email protected]
regards,
Ankit BhansaliIf the XML schema that you find as Xml attributes on the fields of the structure is good for you, you can just use the XML serializer to serialize it out:
XmlSerializer ser = new XmlSerializer(typeof(BRFCKNA1));
ser.Serialize(...); -
hi guys,
i was wondering if the bapi return table with the types, is it possible that the type 'E' and the type 'W' co-exist in the return table.
'cause my program now need to make a judging under the type 'W'.
thanks.Adamyam,
It is possible to get a Warning and Error for a single transaction.
Warnings are discarded and the transaction will go further, however when a Error happens processing is stoppped and is not taken further.
Regards,
Ravi
Note : Please reward points if this helps. -
Hello experts,
I would like a way to quickly handle the BAPI return table (TYPE TABLE OF bapiret2). I would like to pass the table into a function module or helper method to popup all the messages at once. This is the same way MIGO (and many other programs) do a popup of messages with little red, yellow, and green icons to the left. Currently I am using a series of calls to function module BAL_LOG_... and I feel there has to be a better way.
I tried searching for the answer to this question, but if the answer exists, it is buried within the noise of a million people saying use 'POPUP_TO_CONFIRM' and other function modules. To clarify: I do not want buttons to confirm. I want a popup of a list of messages with red, yellow, and green icons on the left.
Whoever answers my question correctly will henceforth be referred to by me as "the Magnificent."My 2 cents ...
IF_RECA_MESSAGE_LIST is the most convenient message handler i have used so far So i would use it in this way -
Get the instance using the factory class CF_RECA_MESSAGE_LIST=>CREATE( ).
Add the BAPI messages using the method ADD_FROM_BAPI( ).
Get the handle via GET_HANDLE( ) & display using function BAL_DSP_LOG_DISPLAY.
DATA(o_msg_list) = cf_reca_message_list=>create( ).
o_msg_list->add_from_bapi(
EXPORTING
it_bapiret = VALUE #( id = 'BC_IBF'
( type = 'I' number = '008' )
type = 'E' ( number = '050' message_v1 = 'AA')
( number = '051' message_v1 = 'BB')
( number = '055' message_v1 = 'CC')
DATA st_log_disp_prof TYPE bal_s_prof.
CALL FUNCTION 'BAL_DSP_PROFILE_POPUP_GET'
IMPORTING
e_s_display_profile = st_log_disp_prof.
st_log_disp_prof-use_grid = abap_true.
st_log_disp_prof-disvariant
= VALUE #( handle = o_msg_list->get_handle( )
report = sy-repid
CALL FUNCTION 'BAL_DSP_LOG_DISPLAY'
EXPORTING
i_s_display_profile = st_log_disp_prof
EXCEPTIONS
profile_inconsistent = 1
internal_error = 2
no_data_available = 3
no_authority = 4
OTHERS = 5.
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.
BR,
Suhas -
Where I hv to SAVE the ERROR file, got in RETURN table of BAPI for ME51N?
Hi Experts,
Pls. clarify one of my simple doubt that, the functional owner have been asked to create a ERROR file(has given name as PR_ERROR_FILE), for the encountered errors, while uploading the data from flat file into Data Base for Purchase requisation-ME51N tx.
So, am thinking to upload by using a BAPI_PR_CREATE.
1) So, I can catch the ERRORS in RETURN table, then , pls. let me now that, Where I hv to SAVE/Create this ERROR file-PR_ERROR_FILE? Is it C drive?
2) Is I hv to SAVE as a Flat file format?
(the functional guy, is not availble)
Functinal guy words are,
For any errors that occur, those should be written out to an error file so that users can review and correct.
The error file should be name PR_ERRORS_FILE
thanqNo this will be save in the aplication server only...on the given path so any one can read it and rectify the error.
-
Return Table empty in Web Service response
Hi All,
My Question is more of related to Web Service. I have created a Web Service from ABAP for BAPI_PO_GETDETAIL. This BAPI is working fine in R/3.
I am using this particular Web Service in Adobe Form (using only ADOBE LIVECYCLE Designer). It's is working fine If i pass the correct Data(Purchase order no.) I'll get the O/p. In case I put a wrong PO number I am not getting the values in return Table in response. (If i test the BAPI in R/3 i m getting a message in Return table that PO no. doesn't exist)
Any Help will be appreciated.
PS; I m using Adobe liveCycle designer 7.1 and Acrobat Professional 9.
Regards,
SachinHi,
It is sufficient to make changes in the WebService Definition.
I communicated wrong entries, do make changes like: follow the previous steps and goto the se80 to respective webservice and do make changes in both External View and Internal View, as when you go into these views you'll find under some node "Input" and "Output", here need to do changes in tables present in the "input" and "output" as when you go into "input" or "output" to a respective table there you'll find two sections "External" and "Abap" do edit in Section "External" as Check the checkbox "Exposed" and Uncheck the checkbox "Optional" also "Min Occurr" should be "1" and "Max occurr" should be unbounded.
Make sure in the Adobe Form, for the button which you are calling the webservice, goto the object pallette of that button and goto execute tab and there check the checkbox "Re-merge form data" or if you are invoking the webservice through scripting then you make change the script like"......execute(1)...".
Regards
Pradeep Goli -
Hi all
I would like to know how to access the RETURN message from the BAPI
In one of our MAM implementation our client has a customized goods issue transaction so when the goods are ordered from the mobile for a maintenance activity the corresponding response from the backend(R/3) is sent in MAM25_001 return table.
Thanks
GopiHi Gopi,
I am not sure whether i understand the quiry properly or not. I hope the following will help you:
1)Take one scenario, customer syncbo, where we need to create customer, when the create BAPI is invoked, it will get executed and gives a messege saying that
"customer is sucessfully created"(These messeges can be modified/create as our wish) so
If this is ur requirement.
We need to create a messege class and call this class in BApi as below
lds_return-message_v1 = 'Customer table'.
lds_return-message_v2 = customerid.
MESSAGE s002(MESSEGE CLASS) WITH space space
INTO gdf_message_dummy .
CALL FUNCTION 'BALW_BAPIRETURN_GET1'
EXPORTING
type = 'E'
cl = 'MESSEGE CLASS'
number = '002'
par1 = lds_return-message_v1
par2 = lds_return-message_v2
IMPORTING
bapireturn = lds_return.
MOVE-CORRESPONDING lds_return TO return.
EXIT.
In this messege class we can create as many messeges as we want, and simple call the messege number..in this case s002 is the messege number.
I hope this will be helpful.
Thanks & Regards,
Karthick -
Hi,
I want to learn BAPI,can anyone send me the documentation regarding BAPI.
Like what is BAPI?
use of BAPI?
When the BAPI will be used..........
Thanx in advance.Hi,
BAPI-step by step
http://www.sapgenie.com/abap/bapi/example.htm
list of all bapis
http://www.planetsap.com/LIST_ALL_BAPIs.htm
for BAPI's
http://www.sappoint.com/abap/bapiintro.pdf
http://www.sappoint.com/abap/bapiprg.pdf
http://www.sappoint.com/abap/bapiactx.pdf
http://www.sappoint.com/abap/bapilst.pdf
http://www.sappoint.com/abap/bapiexer.pdf
http://service.sap.com/ale
http://service.sap.com/bapi
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCMIDAPII/CABFAAPIINTRO.pdf
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/CABFABAPIREF/CABFABAPIPG.pdf
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCFESDE8/BCFESDE8.pdf
http://www.planetsap.com/Bapi_main_page.htm
http://www.topxml.com/sap/sap_idoc_xml.asp
http://www.sapdevelopment.co.uk/
http://www.sapdevelopment.co.uk/java/jco/bapi_jco.pdf
Also refer to the following links..
www.sappoint.com/abap/bapiintro.pdf
www.sap-img.com/bapi.htm
www.sap-img.com/abap/bapi-conventions.htm
www.planetsap.com/Bapi_main_page.htm
www.sapgenie.com/abap/bapi/index.htm
Checkout !!
http://searchsap.techtarget.com/originalContent/0,289142,sid21_gci948835,00.html
http://techrepublic.com.com/5100-6329-1051160.html#
http://www.sap-img.com/bapi.htm
http://www.sap-img.com/abap/bapi-conventions.htm
http://www.sappoint.com/abap/bapiintro.pdf
BAPI
http://help.sap.com/saphelp_46c/helpdata/en/9b/417f07ee2211d1ad14080009b0fb56/frameset.htm
http://searchsap.techtarget.com/originalContent/0,289142,sid21_gci948835,00.html
http://www.sapgenie.com/abap/bapi/example.htm
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCMIDAPII/CABFAAPIINTRO.pdf
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/CABFABAPIREF/CABFABAPIPG.pdf
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCFESDE8/BCFESDE8.pdf
u can check the below the material also
what is BAPI?
BAPI stands for Business API(Application Program Interface).
I have answered this question before..
A BAPI is remotely enabled function module ie it can be invoked from remote programs like standalone JAVA programs, web interface etc..
You can make your function module remotely enabled in attributes of Function module but
A BAPI are standard SAP function modules provided by SAP for remote access. Also they are part of Businees Objest Repository(BOR).
BAPI are RFC enabled function modules. the difference between RFc and BAPI are business objects. You create business objects and those are then registered in your BOR (Business Object Repository) which can be accessed outside the SAP system by using some other applications (Non-SAP) such as VB or JAVA. in this case u only specify the business object and its method from external system in BAPI there is no direct system call. while RFC are direct system call Some BAPIs provide basic functions and can be used for most SAP business object types. These BAPIs should be implemented the same for all business object types. Standardized BAPIs are easier to use and prevent users having to deal with a number of different BAPIs. Whenever possible, a standardized BAPI must be used in preference to an individual BAPI.
The following standardized BAPIs are provided:
Reading instances of SAP business objects
GetList ( ) With the BAPI GetList you can select a range of object key values, for example, company codes and material numbers.
The BAPI GetList() is a class method.
GetDetail() With the BAPI GetDetail() the details of an instance of a business object type are retrieved and returned to the calling program. The instance is identified via its key. The BAPI GetDetail() is an instance method. BAPIs that can create, change or delete instances of a business object type
The following BAPIs of the same object type have to be programmed so that they can be called several times within one transaction. For example, if, after sales order 1 has been created, a second sales order 2 is created in the same transaction, the second BAPI call must not affect the consistency of the sales order 2. After completing the transaction with a COMMIT WORK, both the orders are saved consistently in the database.
Create( ) and CreateFromData! ( )
The BAPIs Create() and CreateFromData() create an instance of an SAP business object type, for example, a purchase order. These BAPIs are class methods.
Change( )
The BAPI Change() changes an existing instance of an SAP business object type, for example, a purchase order. The BAPI Change () is an instance method.
Delete( ) and Undelete( ) The BAPI Delete() deletes an instance of an SAP business object type from the database or sets a deletion flag.
The BAPI Undelete() removes a deletion flag. These BAPIs are instance methods.
Cancel ( ) Unlike the BAPI Delete(), the BAPI Cancel() cancels an instance of a business object type. The instance to be cancelled remains in the database and an additional instance is created and this is the one that is actually canceled. The Cancel() BAPI is an instance method.
Add<subobject> ( ) and Remove<subobject> ( ) The BAPI Add<subobject> adds a subobject to an existing object inst! ance and the BAPI and Remove<subobject> removes a subobject from an object instance. These BAPIs are instance methods.
Example Code
U need to give the step_nr, item_nr, cond_count and cond_type so the correct conditon will be updated. If no condition exists for the given parameters, a new condition will be created.
U can find these parameters for a particular condition type in table KONV.
*& Form saveTransactionJOCR
text
--> p1 text
<-- p2 text
FORM saveTransactionJOCR .
data: salesdocument like BAPIVBELN-VBELN,
order_header_inx like bapisdh1x,
order_header_in like bapisdh1,
return type standard table of bapiret2 with header line,
conditions_in type standard table of bapicond with header line,
conditions_inx type standard table of bapicondx with header line,
logic_switch like BAPISDLS,
step_nr like conditions_in-cond_st_no,
item_nr like conditions_in-itm_number,
cond_count like conditions_in-cond_count,
cond_type like conditions_in-cond_type.
salesdocument = wa_order_information-VBELN.
LOGIC_SWITCH-COND_HANDL = 'X'.
order_header_inx-updateflag = 'U'.
conditions
clear conditions_in[].
clear conditions_inx[].
clear: step_nr,
item_nr,
cond_count,
cond_type.
step_nr = '710'.
item_nr = '000000'.
cond_count = '01'.
cond_type = 'ZCP2'.
CONDITIONS_IN-ITM_NUMBER = item_nr.
conditions_in-cond_st_no = step_nr.
CONDITIONS_IN-COND_COUNT = cond_count.
CONDITIONS_IN-COND_TYPE = cond_type.
CONDITIONS_IN-COND_VALUE = 666.
CONDITIONS_IN-CURRENCY = 'EUR'.
append conditions_in.
CONDITIONS_INX-ITM_NUMBER = item_nr.
conditions_inx-cond_st_no = step_nr.
CONDITIONS_INX-COND_COUNT = cond_count.
CONDITIONS_INX-COND_TYPE = cond_type.
CONDITIONS_INX-UPDATEFLAG = 'U'.
CONDITIONS_INX-COND_VALUE = 'X'.
CONDITIONS_INX-CURRENCY = 'X'.
append conditions_inx.
CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
EXPORTING
SALESDOCUMENT = salesdocument
ORDER_HEADER_IN = order_header_in
ORDER_HEADER_INX = order_header_inx
LOGIC_SWITCH = logic_switch
TABLES
RETURN = return
CONDITIONS_IN = conditions_in
CONDITIONS_INX = conditions_inx
if return-type ne 'E'.
commit work and wait.
endif.
ENDFORM. " saveTransactionJOCR
Bdc to Bapi
The steps to be followed are :
1. Find out the relevant BAPI (BAPI_SALESORDER_CHANGE for VA02).
[for VA01 use BAPI_SALESORDER_CREATEFROMDAT2]
2. Create a Z program and call the BAPi (same as a Funtion module call).
2. Now, if you see this BAPi, it has
-> Importing structures.
eg: SALESDOCUMENT: this will take the Sales order header data as input.
-> Tables parameters:
eg: ORDER_ITEM_IN: this will take the line item data as input.
Note :
Only specify fields that should be changed
Select these fields by entering an X in the checkboxes
Enter a U in the UPDATEFLAG field
Always specify key fields when changing the data, including in the checkboxes
The configuration is an exception here. If this needs to be changed, you need to complete it again fully.
Maintain quantities and dates in the schedule line data
Possible UPDATEFLAGS:
U = change
D = delete
I = add
Example
1. Delete the whole order
2. Delete order items
3. Change the order
4. Change the configuration
Notes
1. Minimum entry:
You must enter the order number in the SALESDOCUMENT structure.
You must always enter key fields for changes.
You must always specify the update indicator in the ORDER_HEADER_INX.
2. Commit control:
The BAPI does not run a database Commit, which means that the application must trigger the Commit so that the changes are read to the database. To do this, use the BAPI_TRANSACTION_COMMIT BAPI.
For further details... refer to the Function Module documentation for the BAPi.
Bapi to VB(Visual Basic)
Long back I had used the following flow structure to acheive the same.
Report -> SM59 RFC destination -> COM4ABAP -> VB.exe
my report uses the rfc destination to create a COM session with com4abap. com4abap calls the vb.exe and manages the flow of data between sap and vb exe.
You need to have com4abap.exe
If com4abap is installed you will find it in sapgui installatin directory , C:\Program Files\SAPpc\sapgui\RFCSDK\com4abap.
else refer OSS note 419822 for installation of com4abap
after making the settings in com4abap to point to the vb program and setting up rfc destination in sm59 to point to com4abap session , you can use the following function modules to call the vb code.
for setting up com4abap and rfc destination please refer to the documentation for com4abap.
Invoke NEW DCOM session
call function 'BEGIN_COM_SESSION'
exporting
service_dest = service_dest "(this will be a RFC destination created in SM59)
importing
worker_dest = worker_dest
exceptions
connect_to_dcom_service_failed = 1
connect_to_dcom_worker_failed = 2
others = 3.
call function 'create_com_instance' destination worker_dest
exporting
clsid = g_c_clsid
typelib = g_c_typelib
importing
instid = g_f_oid
exceptions
communication_failure = 1 message g_f_msg
system_failure = 2 message g_f_msg
invalid_instance_id = 3
others = 4.
call function 'com_invoke' destination worker_dest
exporting
%instid = g_f_oid
%method = 'UpdatePDF'
sntemp = g_v_const_filent
snsysid = sy-sysid
snflag = 'N'
tables
rssaptable = g_t_pdfdetail1
%return = g_t_pdfdetail1 "t_test
exceptions
communication_failure = 1 message g_f_msg
system_failure = 2 message g_f_msg
invalid_instance_id = 3
others = 4.
then close the com session , using
FM delete_com_instance
FM END_COM_SESSION
Regards,
Priyanka. -
Is there any BAPI returning the affected organisational units to users?
Dear all,
I would like to ask a question about organizational units. Whenever I want to affect a user to a given unit I
use PPOME transaction. If I want to do this in ABAP level I use the function module RH_RELATION_WRITE.
I would like to know, is there any BAPI returning the affected organizational unit to a given user?
Thanks in advance,
Kind Regards,
DariyooshAlberto Sesma wrote:
You can use Function Module RH_STRUC_GET
>
>
> CALL FUNCTION 'RH_STRUC_GET'
> EXPORTING
> ACT_OTYPE = 'US'
> ACT_OBJID = user_name
> ACT_WEGID = 'US_CP_O'
> TABLES
> RESULT_TAB = LT_RESULT_TAB.
>
>
> You will get the related org units in LT_RESULT_TAB. There are other two table parameters in that function module that you may find useful.
>
> If the function does not return any valid data you may try with other values for WEGID. You will find all the possible evaluation paths in transaction OOAW.
>
> Kind regards
Dear Alberto,
Thank you very much for your answer. I didn't know this FM and it solved my problem.
For those who may be intered here is exactly I proceed. Suppose that in the table HRP1000 you have an
structure (type S) with ObjID = 50000342 and you wish to have the SapUserID of the affected persons.
DATA:
affected_users TYPE STANDARD TABLE OF swhactor,
user LIKE LINE OF affected_users.
START-OF-SELECTION.
CALL FUNCTION 'RH_STRUC_GET'
EXPORTING
act_otype = 'S'
act_objid = '50000342'
act_wegid = 'A008'
act_plvar = '01'
act_begda = sy-datum
act_endda = sy-datum
act_tdepth = 0
TABLES
result_tab = affected_users
EXCEPTIONS
NO_PLVAR_FOUND = 1
NO_ENTRY_FOUND = 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.
LOOP AT affected_users INTO user.
WRITE: / user-objid.
ENDLOOP.
Also in transaction OOAW we can have all possible values for the third argument of the module function (act_wegid).
For those who are interested, here are a few among many possible values which seem to be intesting for my
problem.
DFPS_DG1----
Organizational Unit of User
DFPS_DG3----
All Org. Units Above a User
ORGAS----
Closest Organizational Unit and structure
ORGASS----
Closest Organizational Unit and structure
PPLEORG -
Organizational unit of an employee or position
SAP_ORGP----
Organizational assignments of a user/person
SAP_USOG----
Organizational Assignments of a User
SAP_US_S----
Positions and Personnel Number of a User
US_S_S_C----
All positions and jobs of a user
WFM_ORGU----
Organizational Assignment of User
WF_ORGUN----
Organizational unit of a user/person (module id Ben./Pers.)
For example, let's say we have a userid named MYUSER01 and we would like to find all structures to which the user
is affected. Here is how I proceed.
DATA:
itab_user_structures TYPE STANDARD TABLE OF swhactor,
row_user_structures LIKE LINE OF itab_user_structures.
START-OF-SELECTION.
CALL FUNCTION 'RH_STRUC_GET'
EXPORTING
act_otype = 'US'
act_objid = 'MYUSER01'
act_wegid = 'US_S_S_C'
act_plvar = '01'
act_begda = sy-datum
act_endda = sy-datum
act_tdepth = 0
TABLES
result_tab = itab_user_structures
EXCEPTIONS
NO_PLVAR_FOUND = 1
NO_ENTRY_FOUND = 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.
LOOP AT itab_user_structures INTO row_user_structures.
WRITE: / row_user_structures-objid.
ENDLOOP.
Thank you very much for your help.
Kind Regards,
Dariyoosh -
Explore return table BAPI_MATERIAL_SAVEDATA
Hi Friends,
I would like write the content of the return table in BAPI_MATERIAL_SAVEDATA.
The code is like this.
REPORT Z_CREATE_MAERIAL_BAPI.
data clientdata type BAPI_MARA.
data wa_clientdata TYPE bapi_mara_ga.
data up_clientdata type TABLE OF BAPI_MARA_GA.
data HEADERDATA TYPE BAPIMATHEAD.
data RETURN type BAPIRET2.
data wa_return...................?????????
CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
EXPORTING
HEADDATA = HEADERDATA
CLIENTDATA = clientdata
IMPORTING
RETURN = return
LOOP AT return INTO wa_return.
WRITE: / 'Return Type: ', wa_return-type.
WRITE: / 'Return ID: ', wa_return-id.
WRITE: / 'Return #: ', wa_return-number.
WRITE: / 'Message 1: ', wa_return-message.
WRITE: / 'Message 2: ', wa_return-message_v1.
WRITE: / 'Message 3: ', wa_return-message_v2.
WRITE: / 'Parameter: ', wa_return-parameter.
WRITE: / 'Row: ', wa_return-row.
WRITE: / 'Field: ', wa_return-field.
WRITE: / 'System: ', wa_return-system.
SKIP.
ULINE.
SKIP.
ENDLOOP.
During the check it says 'return' is no internal table.
How can I manage that.
Thanks in advance for you help.
Rg. Jimbob
Edited by: jimbob on Jun 29, 2008 8:21 PMYes thats true..for this bapi FM return parameter is an export parameter, it is not a table instead it is a structure.
EXPORTING
*" VALUE(RETURN) LIKE BAPIRET2 STRUCTURE BAPIRET2.
You should use RETURNMESSAGES instead of RETURN which is defined under TABLE.
RETURNMESSAGES STRUCTURE BAPI_MATRETURN2.
REPORT Z_CREATE_MAERIAL_BAPI.
data clientdata type BAPI_MARA.
data wa_clientdata TYPE bapi_mara_ga.
data up_clientdata type TABLE OF BAPI_MARA_GA.
data HEADERDATA TYPE BAPIMATHEAD.
data RETURN type BAPIRET2.
data wa_return type BAPI_MATRETURN2.
data returnmessages type standard table of BAPI_MATRETURN2.
CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
EXPORTING
HEADDATA = HEADERDATA
CLIENTDATA = clientdata
IMPORTING
RETURN = return
tables
RETURNMESSAGES = returnmessages.
LOOP AT returnmessages INTO wa_return.
WRITE: / 'Return Type: ', wa_return-type.
WRITE: / 'Return ID: ', wa_return-id.
WRITE: / 'Return #: ', wa_return-number.
WRITE: / 'Message 1: ', wa_return-message.
WRITE: / 'Message 2: ', wa_return-message_v1.
WRITE: / 'Message 3: ', wa_return-message_v2.
WRITE: / 'Parameter: ', wa_return-parameter.
WRITE: / 'Row: ', wa_return-row.
WRITE: / 'Field: ', wa_return-field.
WRITE: / 'System: ', wa_return-system.
SKIP.
ULINE.
SKIP.
ENDLOOP.
Hope it will help.
Regards,
Joy. -
Alter a BAPI Result Table, how to get into the display "loop" ?
Hello all,
i have a problem regarding the result rows of a RFC/BAPI Call.
There are three views, let's say 1,2,3. In View 1, i call a BAPI, and display the results in a table in View 2. I added a button in each row, which calls View 3 and displays some details concerning the selected row.
I now want to store a flag for each row, that has been displayed in this way.
In View 3 i store the key value of the displayed row in an own value node in the context.
When i go back from View 3 to View 2, i want to see that flag (in an extra column) in every row, that has been selected in this session.
So i do not know, how to alter a single row in the BAPI result table, how to get into the "loop" that is used by WD to display the table.
already tried a supply function, but i was not able to alter single rows.
Any suggestions/tips or perhaps code fragments of working supply functions ?
Thank you !Hello,
I'm not sure whether I understood your problem correctly, but I will try to give an answer.
The easiest way I see is to copy the RFC Results to a Component Controller Context structure with an additional Flag field. You can use WDCopyService for copying.
Then on the event of selecting you set your flag as appropriate for you (e.g. if you want to use an image as flag you set the Image path) on the current element of your table. Then display View 3.
On going back View 2 should show now the new flag values...
The trick is to copy the values (as at Time structures can not be expandend with new fields) and set the Flag on the onSelect event.
Hope this helps,
Frank -
Error in BAPI RETURN for Service Contract
Hi,
I get an error in the BAPI Return for the Uploading the Service Contracts by LSMW. The Error Message is E BS No status object is available for &.Also want to know can we upload multiple line of header text for a Contract by this BAPI. If so then how would I do this , as the BAPI structure BAPISDTEXT has textline upto 132 characters. And I am take only one file in LSMW where the header & details come alongwith text. Or could also tell me the file structure of for the data upload. The legacy system sends multiple text in the header for a Contract.For Eg.
Header1 Detail1 Text1
HEader1 Detail2 Text2
Header1 Detail3 Text3
So I would need this text1TEXT2text3 in the Header Text of the Contracts. Or do I need the change the file structure. Many thanks for your time and help.Thanks Nablan, I could do that for multiple header coming in file. But I have a question for you on BAdI ALM_ME_006_GOODSMVT. I have implemented this BAdI , and this BAdI is called by a function Module ALM_MEREP_006_CREATE. When I test this FM giving the Material , Orderid and Movement type entries, this BAdI is triggered when giving a breakpoint. I've given this code for changing the movement type to 961. Cause the stanadrd scenario does not maintain Movement type 961 in Mobile Asset Management. The Movement type 961 for unplanned Materials comes to SAP and changes to 261 as maiantained by TCOKO table. To bypass this & retain the movement type 961 in SAP I'm using this BAdI. Currently this is what I'm doing and am stuck in the method interface how do I call the method.
method IF_EX_ALM_ME_006_GOODSMVT~CREATE .
break-point.
*DATA : i_ce_goodsmovement TYPE REFERENCE
ALM_ME_CUSTOMER_ENHANCEMENT.
DATA : lr_badi_goods_movement TYPE REF TO if_ex_alm_me_006_goodsmvt.
DATA : ls_user_data TYPE ALM_ME_USER_DATA-USERID.
*DATA : goods_movement TYPE ALM_ME_MATERIAL_MOVEMENT.
CALL METHOD lr_badi_goods_movement->create
EXPORTING
ce_goodsmovement = ce_goodsmovement
IMPORTING
user_data = ls_user_data
custom_user_data = ls_ce_user_data
goods_movement = goods_movement
changing
return = return[].
CALL FUNCTION 'ALM_ME_COMMIT_OR_ROLLBACK'
TABLES
return = return.
endmethod.
Please help me to get the data in this method. How do I call this. -
Hi all,
Greetings!
I am facing a probelm with return table, i.e it is adding body record and workarea record also to the data target. so, it is adding the actual record to data target including the workarea record to with the key figure and year values as zeros and spaces. I worked with Return table one or two times, but this time amazing it is adding extra record.
Please guide me..
Thanks and Regards
ChandHi Chand,
Adding extra rows is kind of strange. It must be either, the records in the data request being duplicated or the logic in the RETUN table must be messed up. If possible just have a snapshot of pseud code may be it could help analyzing the error.
Regards,
Praveen -
How to create a log file for bapi return structure
Hi ppl,
I am using BAPI_PO_CHANGE to mark the delivery of POs as complete after many validations through a classic report now my concern is i have been asked to create a log file which details the errors in the POs which is in the bapi return structure.
I don't know how to do can any one help at the earliest.
Regards,
Bharathy.hi
pls see this thread...
it may help you...
/people/kamalkumar.ramakrishnan/blog/2007/01/10/a-primer-on-using-and-creating-sap-application-log
thx
pavan
*pls mark for helpful answers
Maybe you are looking for
-
Writing text vertically and drawing dashed line
Hello, I m trying to write text vertically ( basically to write data on the y-axis of a graph)..Is there a way in which i can set the line direction properties to VERTICAL..? Also, i m trying to draw a dashed line.Can anyone tell me how to do this? T
-
Is there any Fm or Bapi available to see the direct reportees of a manager
Is there any Fm or Bapi available to see the direct reportees of a manager i have the managers id could i get the employees under that manager is there any SAp fm for the same
-
ITunes won't connect to internet
I can't access the iTunes Store, Internet Radio, or download missing album art. This was a problem I had in iTunes 6 as well, I figured iTunes 7 would fix it. No go. Under Help > Run Diagnostics, it confirms that I'm connected to the internet, but th
-
Report script command to get all Level 0 members of a given member
Hi, Is there any Report script command to get all Level 0 members of a given member (Parent)? (very similar to @RELATIVE (mbrName, 0) in Calc Scripts). <DIMBOTTOM gives all the level 0 members in the dimension. There is a command called <LEAVES mbrNa
-
hello there i was wondering is there any class which will change the hour into minutes and back to hours.