2005 Jul 28 11:03 AM
Hi,
Very strange problem. I have the program below;
When I run it , I would expect ls_business_object-Value
to have the contents of header , but it does not, when I look at it in the debugger. It adds the element, but there is nothing in value.
Can't really understand why. I've done this with many other programs without any problem. Thanks.
REPORT test.
data:
ls_business_object TYPE swcont,
lt_business_object TYPE TABLE OF swcont,
HEADER type BAPISDHD1,
HEADER-REFOBJTYPE = ''.
HEADER-DOC_TYPE = 'TA'.
HEADER-SALES_ORG = '1000'.
HEADER-DISTR_CHAN = '10'.
*l_ORDER_HEADER_IN-DIVISION = '00'.
HEADER-PURCH_NO_C = '1234567'.
HEADER-PURCH_DATE = '20050531'.
Pack into swcont
ls_business_object-element = 'HEADER'.
ls_business_object-Value = HEADER.
APPEND ls_business_object TO lt_business_object.
2005 Jul 28 11:18 AM
It is appending the value correctly...just write header & see...since initial few bytes are space ..u r getting like null..when u move ur cursor to the right side u can see the vales in debugger also.
Regards
Jeevi
2005 Jul 28 11:18 AM
It is appending the value correctly...just write header & see...since initial few bytes are space ..u r getting like null..when u move ur cursor to the right side u can see the vales in debugger also.
Regards
Jeevi
2005 Jul 28 11:37 AM
Hi, I don't think so.
Try to type 'LT_BUSINESS_OBJECT[1]-VALUE+80' in your debugger Field Name, you will find the value you set.
2005 Jul 28 11:39 AM
Hi,
In that lt_business_object,it is having 255 char for value.
So I suggest you to do
concatenate
HEADER-REFOBJTYPE
HEADER-DOC_TYPE
HEADER-SALES_ORG
HEADER-DISTR_CHAN
HEADER-PURCH_NO_C
HEADER-PURCH_DATE
into
ls_business_object-Value.
instead of
ls_business_object-Value = HEADER.
Then
APPEND ls_business_object TO lt_business_object.
2005 Jul 28 1:12 PM
It looks like you wanna fill a container or call a method from a business object. Its better to use the macro's defined in the include <CNTN01>.
SWC_CREATE_OBJECT object_name 'Refering object' key to create an object
SCW_CALL_METHOD object_name 'MethodName' method_container to call a method
If you tell what the problem is and what you wanna achieve then i can help you with setting up the correct coding using the macro's above for it.