Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Error in BAPI RETURN for Service Contract

Former Member
0 Likes
2,363

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.

18 REPLIES 18
Read only

nablan_umar
Product and Topic Expert
Product and Topic Expert
0 Likes
2,198

Mira,

Are you talking about BAPI_CONTRACT_CREATEFROMDATA? If it is, CONTRACT_TEXT is an internal table, so you can pass multiple lines.

Read only

0 Likes
2,198

Right that's the FM and I can pass multiple lines without any length restrictions. Because the Textline has 132 CHAR. Thanks again

Read only

0 Likes
2,198

Also I can take the data from the file which will be in one structure. Will I be able to get the Multiple text for the Header in the Contracts. The file structure will be in format.

Header1 Detail1 Text1

HEader1 Detail1 Text2

Header1 Detail2 Text3

Header1 Detail2 SPACE

This is cause the Header1 and Detail2 will contain the same text as Detail1. The Text length from legacy will not have any length restriction if we concatenate. So will this file format be ok for the BAPI Contracts.Or how would you suggest to get into the BAPI. Thanks a tons Nablan if you could help me.

Read only

nablan_umar
Product and Topic Expert
Product and Topic Expert
0 Likes
2,198

I assumed you meant you have 1 header with 2 line items. The first line item has 2 text while the second has only 1 text. If you look at CONTRACT_TEXT, you can place the the text per line item. For your case above, you will need to append to 3 records of CONTRACT_TEXT.

Read only

0 Likes
2,198

Hi Nablan,

Now my header text repeats all the header text coming in a file in one contract order.Whereas I wanted it to be different in the order.And these are not any item details but they are at the Contract level for each detail.

The file structure is:

Header1 Detail1 Text1

Header1 Detail1 Text2

Header1 Detail1 Text3

Header1 Detail1 Text4

Header1 Detail2

Header1 Detail3

Header1 Detail4

Header2 Detail1 Text1

Header2 Detail1 Text2 and so on

As for other Details the text would not be there as they will be the same and it is at the Header level of the order. So how do I take care of the Header. Thanks

Read only

nablan_umar
Product and Topic Expert
Product and Topic Expert
0 Likes
2,198

Hi Mira,

I am still not very clear why you can't place each text into the table as one record.

Read only

0 Likes
2,198

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.

Read only

nablan_umar
Product and Topic Expert
Product and Topic Expert
0 Likes
2,198

Hi Mira,

I don't understand why you need call again the method when you are already in this Badi. A Badi is like a user exit, where SAP supplied function/method that you can manipulate the data or process. In this Badi, there is no Exporting/Change/Table parameters, hence I don't think you can change the data while function module ALM_MEREP_006_CREATE. Looking at the description and parameters of this BADI, I think you use this Badi if you want you own checking/validation during the confirmation process. This Badi provides User data, custom data, goods movement but nothing returned except a RETURN table. This means it should be use for your own validation on custom user data then return an error status in RETURN if you have one.

Read only

0 Likes
2,198

The enhancement structure CE_GOODSMOVEMENT needs to be used. This should be designed as a copy of GOODS_MOVEMENT. Indeed, no more fields need to be used. The only thing needed is logic behind the field MOVE_TYPE.So how would I get the Movement Type field in CE_GOODSMOVEMENT structure and do the validation.

Read only

nablan_umar
Product and Topic Expert
Product and Topic Expert
0 Likes
2,198

Hi Mira,

Field MOVE_TYPE is not in CE_GOODSMOVEMENT. It is in GOODS_MOVEMENT. CE_GOODSMOVEMENT structure contains custom fields you added. Since MOVE_TYPE is from standard SAP, it should be in GOODS_MOVEMENT.

In this Badi, you can just refer to this field by GOODS_MOVEMENT-MOVE_TYPE. I hope this will answer your question.

Read only

0 Likes
2,198

Hi Nablan,

The FUNCTION Module PF_ASTAT_OPEN is used in BAdI but what OPENKEY and TYPE parameter do I need to mention. Also when I call this exit in the method I am implementing, I do not get the CE_goodsmove populated.

call method exitintf->CREATE

exporting

USER_DATA = USER_DATA

CUSTOM_USER_DATA = CUSTOM_USER_DATA

GOODS_MOVEMENT = GOODS_MOVEMENT

CE_GOODSMOVEMENT = CE_GOODSMOVEMENT

changing

RETURN = RETURN

Also I have appended fields to Custome Include CE_GOODSMOVEMENT which is like the structure fields of GOODS_MOVEMENT. Many thanks

Read only

nablan_umar
Product and Topic Expert
Product and Topic Expert
0 Likes
2,198

I don't see PF_ASTAT_OPEN in Badi ALM_ME_006_GOODSMVT. When you said "Also when I call this exit in the method I am implementing, I do not get the CE_goodsmove populated", do you meant you are trying to use this Badi in your own method/program? Badi is an SAP delivered exit, placed at certain place of SAP delivered programs. You can't code it in your own program. Let me know if this is not what you are trying to do.

Read only

0 Likes
2,198

I am trying to get check the Movement Type coming from Mobile device to SAP. When this comes to SAP the FM ALM_MEREP_006_CREATE triggers this BAdI ALM_ME_006_GOODSMVT. I implement this to enhance the CE_GOODSMOVEMENT where I include all the fields that are present in GOODS_MOVEMENT. Now after doing this, in the method CREATE I need to caputure the Movement Type. But I find it coming in GOODS_MOVEMENT structure and not in CE_GOODSMOVEMENT which I enhanced.Now how do I populate this or go about so that I can retain the Movement type 961 and let it change to 261 as the standard does. The standard does it in TCOKO table given in FM. I am using this BAdI to bypass that. Hope this explains what I want. Thanks again

Read only

nablan_umar
Product and Topic Expert
Product and Topic Expert
0 Likes
2,198

So what you are trying to do is to change the Movement Type from 961 to 261. Is this correct? If it is, I don't think this Badi is the correct one for this purpose because as I said before, there is no return parameters from this Badi that you can change except RETURN. This parameter RETURN is used for sending messages to the calling program, for example error message.

Message was edited by: Nablan Umar

Read only

0 Likes
2,198

Sorry it should not change from 961 which is coming. But the Standard scenario changes it to 261 which is not our requirement. & hence to maintain this Movement type 961 I am implementing this BAdI and will deactivate the standard. But my CE_ custom Include structure does not populate or how do I handle this situation.

Read only

nablan_umar
Product and Topic Expert
Product and Topic Expert
0 Likes
2,198

Did you implement CI_ALM_ME_GOODSMOVEMENT using CMOD? Try looking at function modules exit within that component.

Read only

0 Likes
2,198

Hi Nablan,

I have implemented the structure CI_ALM_ME_GOODSMOVEMENT and included fields just as they are in GOODS_MOVEMENT apart from the key fields which are already there in CE_GOODSMOVEMENT. I don't understand whuy do I need to look into CMOD. I guess all I need to do is fill in this Custom Include CI_ALM_ME_GOODSMOVEMENT, in the BADI method.

Read only

nablan_umar
Product and Topic Expert
Product and Topic Expert
0 Likes
2,198

Hi Mira,

Normally you implement the extension structure to place additional fields that are not available in the SAP delivered structure. I am not sure why when you implement CI_ALM_ME_GOODSMOVEMENT, you need to include fields from GOODS_MOVEMENT.