Quantcast
Channel: SCN : Unanswered Discussions - ABAP Development
Viewing all 8768 articles
Browse latest View live

ERROR IN BAPI Purchase order still contains faulty items

$
0
0

Hello Expert,

 

Please help I try to upload service Po from  BAPI_PO_CREATE1 but I an getting error  .

 

Purchase order still contains faulty items

 

 

Please see below code what I am passing .

 

lt_itab_ven[] = lt_itab[].

 

**  SORT lt_itab BY vendor.

**  DELETE ADJACENT DUPLICATES FROM lt_itab COMPARING vendor .

 

   SORT lt_itab BY vendor collect_no.

   DELETE ADJACENT DUPLICATES FROM lt_itab COMPARING vendor collect_no .

 

 

   CLEAR:   g_bapimepoheader,g_bapimepoitem,g_bapimeposchedule,g_poitemx.

   REFRESH: g_bapimepoheader,g_bapimepoitem,g_bapimeposchedule,g_poitemx.

 

   LOOP AT lt_itab INTO ls_itab.

 

     MOVE-CORRESPONDING ls_itab TO g_bapimepoheader.

 

     w_type = ls_itab-doc_type.

 

     CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

       EXPORTING

         input  = ls_itab-vendor

       IMPORTING

         output = ls_itab-vendor.

 

     g_bapimepoheader-vendor     = ls_itab-vendor.

     g_bapimepoheader-creat_date = sy-datum.

     g_bapimepoheader-created_by = sy-uname.

     APPEND  g_bapimepoheader.

 

 

     g_bapimepoheaderx-doc_type    = 'X'.

     g_bapimepoheaderx-vendor      = 'X'.

     g_bapimepoheaderx-doc_date    = 'X'.

     g_bapimepoheaderx-purch_org   = 'X'.

     g_bapimepoheaderx-pur_group   = 'X'.

     g_bapimepoheaderx-comp_code   = 'X'.

     g_bapimepoheaderx-collect_no  = 'X'.

     APPEND  g_bapimepoheaderx.

 

 

     CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'

       EXPORTING

         input  = ls_itab-vendor

       IMPORTING

         output = ls_itab-vendor.

 

 

     lt_itab_lin[] = lt_itab_ven[].

     SORT lt_itab_lin BY vendor.

     DELETE lt_itab_lin WHERE vendor <> ls_itab-vendor.

 

     lt_itab_serv_lin[] = lt_itab_lin[].

*    SORT lt_itab_lin BY short_text.

*    DELETE ADJACENT DUPLICATES FROM lt_itab_lin COMPARING short_text.

 

**    SORT lt_itab_lin BY short_text.

**    DELETE ADJACENT DUPLICATES FROM lt_itab_lin COMPARING short_text.

 

     pkgno = 0.

     LOOP AT lt_itab_lin INTO ls_itab_lin WHERE collect_no = ls_itab-collect_no .

 

       pkgno = pkgno + 1.

       MOVE-CORRESPONDING ls_itab_lin TO g_bapimepoitem.

       g_bapimepoitem-pckg_no = pkgno.

 

       CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

         EXPORTING

           input  = ls_itab_lin-po_item

         IMPORTING

           output = ls_itab_lin-po_item.

       g_bapimepoitem-tax_code = ls_itab_lin-tax_code.    "TAX_CODE

       g_bapimepoitem-po_item  = ls_itab_lin-po_item.

       g_bapimepoitem-quantity = 1.

       APPEND g_bapimepoitem.

       CLEAR  g_bapimepoitem.

 

       MOVE-CORRESPONDING ls_itab_lin TO g_bapimeposchedule.

       g_bapimeposchedule-po_item     = ls_itab_lin-po_item.

       g_bapimeposchedule-quantity    = 1.

       g_bapimeposchedule-sched_line  = 1.

       APPEND  g_bapimeposchedule.

       CLEAR   g_bapimeposchedule.

 

 

       g_poitemx-po_item     = ls_itab_lin-po_item.

       g_poitemx-po_itemx    = 'X'.

       g_poitemx-acctasscat  = 'X'.

       g_poitemx-tax_code = 'X'.

       g_poitemx-item_cat    = 'X'.

       g_poitemx-short_text  = 'X'.

       g_poitemx-matl_group  = 'x'.

       g_poitemx-plant       = 'X'.

       g_poitemx-stge_loc    = 'X'.

       g_poitemx-net_price   = 'X'.

       g_poitemx-quantity    = 'X'.

       g_poitemx-po_unit     = 'X'.

       g_poitemx-orderpr_un  = 'X'.

       g_poitemx-trackingno  = 'X'.

       g_poitemx-delete_ind  = 'X'.

       g_poitemx-pckg_no     = 'X'.

       APPEND  g_poitemx.

       CLEAR   g_poitemx.

 

 

 

       g_poschedulex-po_item         = ls_itab_lin-po_item.

       g_poschedulex-sched_line      = 1.

       g_poschedulex-po_itemx        = 'X'.

       g_poschedulex-sched_linex     = 'X'.

       g_poschedulex-del_datcat_ext  = 'X'.

       g_poschedulex-delivery_date   = 'X'.

       g_poschedulex-quantity        = 'X'.

       g_poschedulex-deliv_time      = 'X'.

       g_poschedulex-stat_date       = 'X'.

       g_poschedulex-preq_no         = 'X'.

       g_poschedulex-preq_item       = 'X'.

       g_poschedulex-po_date         = 'X'.

       g_poschedulex-routesched      = 'X'.

       g_poschedulex-ms_date         = 'X'.

       APPEND  g_poschedulex.

       CLEAR   g_poschedulex.

 

       line_no = 0.

       line_no = line_no + 1.

       g_poservices-pckg_no       = pkgno.

       sub_pkgno = pkgno + 1.

       g_poservices-line_no       = line_no.

       g_poservices-subpckg_no    = sub_pkgno.

       g_poservices-outl_ind      = 'X'.

       g_poservices-quantity      = 1.

       APPEND g_poservices.

       CLEAR g_poservices.

 

       line_no = 0.

       LOOP AT lt_itab_serv_lin INTO ls_itab_serv_lin WHERE collect_no = ls_itab-collect_no .

 

         MOVE-CORRESPONDING ls_itab_serv_lin TO g_poservices.

         g_poservices-pckg_no       = sub_pkgno.

         line_no = line_no + 1.

         g_poservices-line_no       = line_no.

 

         CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

           EXPORTING

             input  = g_poservices-service

           IMPORTING

             output = g_poservices-service.

 

         CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

           EXPORTING

             input  = g_poservices-ext_line

           IMPORTING

             output = g_poservices-ext_line.

 

         APPEND g_poservices.

         CLEAR g_poservices.

 

         g_poaccount-po_item           = ls_itab_lin-po_item.

         g_poaccount-serial_no         = line_no.

         g_poaccount-wbs_element       = ls_itab_serv_lin-wbs_element.

         APPEND g_poaccount.

         CLEAR  g_poaccount.

 

         g_poaccountx-po_item           = ls_itab_lin-po_item.

         g_poaccountx-serial_no         = line_no.

         g_poaccountx-wbs_element       = 'X'.

         APPEND g_poaccountx.

         CLEAR  g_poaccountx.

 

         g_posrvaccessvalues-pckg_no    = sub_pkgno.

         g_posrvaccessvalues-line_no    = line_no.

         g_posrvaccessvalues-serno_line = '01'.

         g_posrvaccessvalues-serial_no  = line_no.

         g_posrvaccessvalues-quantity   = 1.

         APPEND g_posrvaccessvalues..

 

       ENDLOOP.

 

     ENDLOOP.

 

     CLEAR:g_ebeln,gstest.

*    REFRESH g_bapiret2.

 

 

 

     CLEAR: g_ebeln,g_expheader.

 

     CALL FUNCTION 'BAPI_PO_CREATE1'

       EXPORTING

         poheader          = g_bapimepoheader

         poheaderx         = g_bapimepoheaderx

         poexpimpheader    = g_bapieikp

         no_price_from_po  = 'X'

*       TESTRUN           = 'X'

       IMPORTING

         exppurchaseorder  = g_ebeln

         expheader         = g_expheader

       TABLES

         return            = g_bapiret2

         poitem            = g_bapimepoitem

         poitemx           = g_poitemx

         poschedule        = g_bapimeposchedule

         poschedulex       = g_poschedulex

         poaccount         = g_poaccount

         poaccountx        = g_poaccountx

         poservices        = g_poservices

         posrvaccessvalues = g_posrvaccessvalues.

 

 

     IF NOT g_ebeln IS INITIAL.


Transporting Table entries

$
0
0

Hi,

 

I have a table which has three key fields of which one of the key field is a GUID field of data type CHAR 255.I have 500 records in this table. I need to transport the table contents to the next system (TST)

 

As per the below documentation, its not possible to transport the table contents as the length of the key fields is very large. I do not want to try transporting the contents generically as stated in the below document since one of the key field is a GUID.

 

Creating Tables -  ABAP Dictionary - SAP Library

 

Does anyone have an idea as to how I could keep the contents of this table same in both DEV and TST.

 

Thanks,

Murali

How to solve a TIME_OUT error in the program?

$
0
0

Hi Experts,

 

I am try to fix a Time limit exceeded error in the custom program, after review this program, I found there is a subroutine will be performed many times. And there are 3 standard FM  COM_PCAT_CTY_GETITEMLIST_O, COM_PCAT_ITM_GETDETAIL_O and  COM_PRSHTEXT_READ_SINGLE in this subroutine. A lot of SAP SQL & DB open/fetch in these 3 FM, so it will cost a lot of running time. The logic is ok, the requirement need to perform many times subroutine. Currently this program always dump when screen select a big Catalog Name.(Dialog mode & job mode) I think maybe use Parallel Processing call FM staring new task to solve this question,  but basis told me that the parameter of Max. Requests in Queue can't be changed(default is 5) I am afraid it's not enough for my requirement. Is there another way to solve this problem? I hope someone can give me a hint. Thanks!

 

Regards.

Function module /AIF/NOTIFY_IDOC_STATUS does not exist

$
0
0

Hi,

 

When I try to execute a PS IDOC using BAPI_IDOC_INPUT1 in WE19, my idoc goes to this error "FM /AIF/NOTIFY_IDOC_STATUS does not exist". We have no AIF config setup.

 

I debugged WE19 and found that this error is already in SYST fields while the IDOC processing starts in WE19. I am not sure why this error is pre-filled in the SYST structure and where from this error is coming??

 

Any help or suggestions?

 

- Ags

How to Provide exits and enhancement points in program

$
0
0

Hi,

We are doing product development like add-on product. Can anyone tell me that how can I provide some exits and implicit/explicit enhancement point in our program so that later a developer/customer could enhance it by using that?

 

 

Thanks

Piyush

user****has no access authorization for computer *****Message ID:04 Message number: 202

$
0
0

Dear Gurus,

 

I am doing functionality of puting CSV file on external FTP server. I used FM's HTTP_SCRAMBLE, SAPGUI_PROGRESS_INDICATOR,FTP_CONNECT,FTP_R3_TO_SERVER,FTP_DISCONNECT.


But at FTP_CONNECT i am getting error 'user****has no access authorization for computer *****'.

Message ID:          04                         Message number:           202


I tried it using 'RSFTP002' report by entering details still i am getting same error. I checked 'SAPFTPA' connection in SM59 its working fine. Help..

Automatic Tracking no Enter in PR Through MRP

$
0
0

Dear Experts,

 

I was created  one SO in VA01 And MRP Run against SO .MRP Through run generated PR against SO. In PR how I automatically enter Tracking No(SO No.) 

how to do this please help.

 

 

 

Thanks and regards,

Sam

Unable to update HR Master Inbound idoc.

$
0
0

Hi All,

 

I am working on one req of Inbound idoc,HR module. The requirement is to create Activity type and update in PA0315 table which I am able to implement but there is one other requirement where I have to clear job group field data so that It can’t be seen in the idoc as it is a confidential data.

I have implemented my code in User exit ZXHALU07 and BADI HRALE00INBOUND_IDOC,I tried so many ways but not able to clear the Job group field data from the idoc.

 

can provide some help.


Thanks,


Inserting non-sequentially to DB table

$
0
0

Hello,

 

Say, I have a custom table with few million records with key being 10 characters long. Now, lets say the rows that have been inserted are not sequential.  If few such non-sequential rows are inserted to this custom table now and then, how would the performance be?

 

Regards, Madan..

report getting dump in Production but not in Quality and development

$
0
0

Hi Experts,

opening closing report getting dump in PRD but not in QUA and DEV.

it dumps at function module  ZGL_OPENING_CLOSING_BAL_KEY this part displays previous balance.

Plz Help Me.

 

 

Regards,

Sam

Identifying all objects to transport from a package

$
0
0

I want to be able to transport all transportable objects related to a package, taking account of versions in table VRSD, but I have hit a snag:

 

1) Table TADIR allows you to list objects contained in a package by searching on DEVCLASS (Paskage name).

 

2) However, this does not reveal the objects that will actually appear in a transport request in VRSD.

 

For instance, in TADIR there will be an entry for a class such as PGMID = 'R3TR', OBJECT = 'CLAS' and OBJ_NAME = class name. However, in the transport request will appear objects such as OBJTYPE = 'CPUB', OBJNAME = class name

 

So although I can find object type 'CLAS' in TADIR, the actual objects transported are of different types.

 

I had a look at transaction SOTG, which shows the relationship between the object type groups and dependent types, but there are a couple of problems with this, namely, the object can appear in multiple groups (e.g. CLAS appears in groups OO_TYPE, SOURCE_BASED and several others; CPUB appears in OO_SECTIONS, which is a subgroup of OO_TYPE, but the relationshp is not direct, and no way to tell what sub-objects belong in a transport.

 

Does anybody know, is there a way to determine for each type in TADIR, what objects will appear in the transport and table VRSD?

Change GL account via MM07MFF9_F_BELEG_ERGAENZEN

$
0
0

I need to change the GL account posting (via MIGO) for goods receipt for certain vendors.

 

I read that this can be done by making an enhancement in MM07MFF9_F_BELEG_ERGAENZEN to edit the structure xaccit. But I can't see how to make an enhancement after the call to CKMV_AC_DOCUMENT_CREATE.  Before this call, the xaccit is empty so I can't use it.

 

I believe it may be possible to make the GL account change by substitution but I'm wondering if the above approach is possible?

How to check KTOKD value while entring the KUNNR

$
0
0

Hello,

 

I have developed an application (A custom table and a module pool with editable ALV of this custom table).

 

In ALV, user can enter the value of all the fields along with KUNNR (only KUNNR, not KTOKD).

 

There is a requirement that "We need to allow to enter only Customer number of a Defined type(Z001, Z002)."

If the customer number entered is not part of the account group defined in the table an error message has to be displayed.


Please tell me that how can I handle this requirement using Check Table concept and Foreign key concept?


Suggestions are welcome

TAXACCOUNT structure issue in BAPI_ACC_DOC_POST

$
0
0

Hi Experts,

 

I am trying to write a mass upload program to park documents using BAPI_ACC_DOCUMENT_POST.

 

31     960000000(vendor)              1540.00-(ve)

40     406050(G/L)               P1     1400.00+(ve)

40     29500(tax acc)           P1      140 +(Ve)

 

 

From the above posting key 31 , end user will supply gross amount(1540) & tax amount(140)

                        posting key 40 (as per screen shot item 2 & 3 ) end user will supply net amount(1400) & tax code (p1) as single entry.

 

My question is when I am trying to post/park document with the below given structure it actually gives the success message but when see the parked document it looks as below screen shot . As in screen Debit- & Credit are not balanced instead I have no idea how it is getting 1680.00 as Debit?

 

I will be using FM to CALCULATE_TAX_FROM_NET_AMOUNT or CALCULATE_TAX_FROM_GROSS_AMOUNT with taxcode 'P1' as given with posting key 40 abecause for item '003' in screen user is not proving any details it could be worked out with to get GL etc from FM.

 

I have shared my current logic . Please correct my logic of where I am missing any essential field in BAPI structure.

 

Capture.PNG

 

lw_acc_vr-itemno_acc = '0000000001'.

lw_Acc_vr-vendor_no = '0096004547'.

lw_acc_vr-comp_code = '8720'.


lw_curr_amt-itemno_acc = '0000000001'.

lw_curr_amt-currency = 'AUD'.

lw_curr_amt-currency_iso = 'AUD'.

lw_curr_amt-amt_doccur = '-1540.00'


****************************************************************

lw_acc_gl-itemno_acc = '0000000002'.

lw_acc_gl-gl_account = '0000406260'.

lw_acc_gl-item_text = 'tst_value_2'.

lw_acc_gl-doc_type = 'KR'.

lw_acc_gl-comp_code = '8720'.

lw_acc_gl-tax_code = 'P1'.

lw_acc_gl-orderid =   '000008267848'.


lw_curr_amt-itemno_acc = '0000000002'.

lw_curr_amt-currency = 'AUD'.

lw_curr_amt-currency_iso = 'AUD'.

lw_curr_amt-amt_doccur = '1400.00'.

 

*****************************************************************

lw_acc_tax-itemno_acc = '0000000003'.

lw_acc_tax-gl_account = '0000249500'.

lw_acc_tax-tax_code = 'P1'.

lw_acc_tax-tax_rate = '10.000'.


lw_curr_amt-itemno_acc = '0000000003'.

lw_curr_amt-curr_type = '00'.

lw_curr_amt-currency = 'AUD'.

lw_curr_amt-currency_iso = 'AUD'.

lw_curr_amt-amt_doccur = '140.00'.

lw_curr_amt-amt_base = '1400.00'.


*******************************************************************



Additional field in Reservation Creation

$
0
0

User needs an optional input field Equipment Code in Reservation creation screen (MB21).

 

 

Please suggest the process to include this as a HEADER level field.


Unable to Debug in Eclipse

$
0
0

Guys,

 

Do anyone know how to fix this issue.?

 

Issue: When i debug, i get the following message "Debugger  cannot be launched because application server host cannot be reached from this Machine. See SAP note 1906917" for details."

 

Thanks

Chandru.R

Status_read FM not working properly in outbound idoc

$
0
0

Hi all,

 

I am updating custom segment with status of quotation in outbound idoc FM (IDOC_OUTPUT_ORDRSP ) in exit EXIT_SAPLVEDC_003

 

1. Status_read Function module working fine for all status in runtime except approval status for pending status it is working fine. ( I checked the code with hardcoded text for approval Status and it works , So Jest table not  updating approval status at run time process ).

 

2. Status_read FM not returning approval status at runtime from va22 , but if we run the idoc manually then it works fine .

 

* Get BELNR ( Which will have the Sales order number in this interface )
       lv_vbeln = ls_e1edk01-belnr.

* Converting to internal format
       CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
         EXPORTING
           input  = lv_vbeln
         IMPORTING
           output = lv_vbeln.


       IF lv_vbeln IS NOT INITIAL.
* Get Sales Order Header details

         SELECT SINGLE vbeln
                       erdat
                       erzet
                       ernam
                       angdt
                       auart
                       objnr
                       ktext
                       vkorg FROM vbak INTO ls_vbak
                                   WHERE vbeln EQ lv_vbeln.
         IF sy-subrc EQ 0.

* Get the Status Profile and User Stauts
           CALL FUNCTION 'STATUS_READ'
             EXPORTING
               objnr            = ls_vbak-objnr
               only_active      = lc_x
             IMPORTING
               obtyp            = lv_obtyp
               stsma            = lv_stsma
               stonr            = lv_stonr
             TABLES
               status           = lt_status
             EXCEPTIONS
               object_not_found = 1
               OTHERS           = 2.
           IF sy-subrc EQ 0.
* Delete records other than the User status
             DELETE lt_status WHERE stat NA lc_e.

* Read the active user status
             READ TABLE lt_status INTO ls_status WITH KEY inact = space.
             IF sy-subrc EQ 0.
               IF lv_stsma IS NOT INITIAL AND ls_status-stat IS NOT INITIAL.
                 SELECT SINGLE txt30 FROM tj30t INTO ( lv_text )
                                       WHERE stsma EQ lv_stsma
                                        AND  estat EQ ls_status-stat
                                        AND  spras EQ sy-langu. "#EC WARN_OK
               ENDIF.
             ENDIF.
* Object status text
           ENDIF.
         ENDIF.


Please help me in this

Error while confirmation of Order in Co11n?

$
0
0

Dear Expertise

 

I am using one exit for co11n.

CONFPP05

 

Now, In this I am using one validation  on BWART and RGEKZ(Backflush Indicator).

 

Now, when I run Co11n and enter the details, its working fine for my Error message which I have displayed if Backflush is null for Order No.

 

Now, when i press BACK or SAVE , it ask me with a POP UP "Do you want to save the confirmation"

I click on yes. It throws a dump as

 

Exception condition "DUPREC" triggered

 

 

I have already searched on this Dump but not able to sort out this issue.

 

Help me to sort out this issue gurus.

 

 

 

 

Thanks

 

karan

Rental object (RE-FX) connectivity with building

$
0
0

Hello All,

 

Building had rental objects in it which i can see in table VIBDRO as well VIBDBU.

 

Sample example(VIBDBU)

 

Object id          Company code  IMKEY

BX78912345    1000                 000053

 

Sample Example (VIBDRO)

 

Object id     Company Code   IMKEY      asset id    asset assignment

iM0009          1000                  000053    200061     +09

IM0010          1000                  000054    200061     +10

IM0011          1000                  000055    200061     +11

 

here in the above example first 2 records belong to building(BX78912345).Want to know from which table i can get the object id of VIBDRO table 

 

Thanks In advance

 

Sravya

Data is not displayed in treeview table CRM BOL.

$
0
0

I used this tutorial Drag and Drop in Tree Type BSP View to create a treeview as an example for us to use in a client application. But the result table is displayed without the texts as image below. The quantity of lines, as well as the hierarchy is correct according to what was selected in the table, but the text does not appear as the image below.

 

nodes.JPG

 

Table data source

tabela.jpg

Result table treeview

SCN.JPG

Folow implemented code:

 

method DO_INIT.
CALL METHOD SUPER->DO_INIT
.

IF gr_drag_drop IS NOT BOUND.
* Drag and drop iterator
CREATE OBJECT gr_drag_drop.
ENDIF.

SELECT *
FROM ZTREE_PRODUCT
INTO TABLE gt_tree_product.
endmethod.

 

method DO_PREPARE_OUTPUT.
*CALL METHOD SUPER->DO_PREPARE_OUTPUT
**  EXPORTING
**    IV_FIRST_TIME = ABAP_FALSE
*    .
TYPES: BEGIN OF ltype_attr_struct,
product_id
TYPE ztree_product-product_id,
prod_company
TYPE ztree_product-prod_company,
prod_type
TYPE ztree_product-prod_type,
parent_id
TYPE ztree_product-parent_id,

END OF ltype_attr_struct.

DATA: lv_struct_ref TYPE REF TO ltype_attr_struct,
lv_value_node
TYPE REF TO cl_bsp_wd_value_node,
lv_size_s    
TYPE i,
lv_size_d    
TYPE i,
lv_bo_coll   
TYPE REF TO if_bol_bo_col.

DATA: ls_tree_product     TYPE ltype_attr_struct," ztree_product,
ls_tree_product_tmp
TYPE ltype_attr_struct, "ztree_product,
lt_tree_product    
TYPE STANDARD TABLE OF ltype_attr_struct. "ztree_product_tt.

FIELD-SYMBOLS: <lfs_tree_product> LIKE LINE OF gt_tree_product,
<lfs_tree_prod>   
LIKE LINE OF lt_tree_product.

*  typed_context->product->collection_wrapper->clear_collection( ).
REFRESH lt_tree_product.
IF iv_first_time IS NOT INITIAL.

CREATE OBJECT lv_bo_coll TYPE cl_crm_bol_bo_col.

*    lt_tree_product[] = gt_tree_product[].
LOOP AT gt_tree_product ASSIGNING <lfs_tree_product>.
APPEND INITIAL LINE TO lt_tree_product ASSIGNING <lfs_tree_prod>.
MOVE-CORRESPONDING <lfs_tree_product> TO <lfs_tree_prod>.
ENDLOOP.

DELETE lt_tree_product WHERE parent_id IS NOT INITIAL.
CREATE DATA lv_struct_ref.
LOOP AT lt_tree_product INTO ls_tree_product.
*      CREATE DATA lv_struct_ref.
CREATE OBJECT lv_value_node
EXPORTING
iv_data_ref
= lv_struct_ref.
CALL METHOD lv_value_node->if_bol_bo_property_access~set_properties
EXPORTING
is_attributes
= ls_tree_product.
lv_bo_coll
->add( lv_value_node ).

ENDLOOP.

typed_context
->product->collection_wrapper->set_collection( lv_bo_coll ).
typed_context
->product->refresh( ).
ENDIF.

CALL METHOD super->do_prepare_output
EXPORTING
iv_first_time
= iv_first_time.

endmethod.

 

method REFRESH.
*CALL METHOD SUPER->REFRESH
*    .
DATA : lr_iterator TYPE REF TO if_bol_bo_col_iterator,
lr_entity  
TYPE REF TO if_bol_bo_property_access,"cl_crm_bol_entity,
lr_root    
TYPE REF TO if_bsp_wd_tree_node.

TRY.
lr_iterator
= me->collection_wrapper->get_iterator( ).
lr_entity ?= lr_iterator
->get_first( ).
WHILE lr_entity IS BOUND.
lr_root
= me->node_factory->get_proxy(
iv_bo        
= lr_entity
iv_proxy_type
= 'ZCL_PRODUCT_TREE' ).
lr_root
->node_key = add_root_node( lr_root ).
*        exit.
lr_entity ?= lr_iterator
->get_next( ).
ENDWHILE.

CATCH cx_sy_move_cast_error cx_sy_ref_is_initial.
ENDTRY.
endmethod.

 

method IF_BSP_WD_TREE_NODE~GET_CHILDREN.
*CALL METHOD SUPER->IF_BSP_WD_TREE_NODE~GET_CHILDREN
**  EXPORTING
**    is_sort_wish =
*  RECEIVING
*    RT_CHILDREN  =
*    .
TYPES: BEGIN OF line,
product_id
TYPE ztree_product-product_id,
prod_company
TYPE ztree_product-prod_company,
prod_type
TYPE ztree_product-prod_type,
parent_id
TYPE ztree_product-parent_id,
END OF line.
DATA: lr_child     TYPE REF TO if_bsp_wd_tree_node,
lv_size_s   
TYPE i,
lv_size_d   
TYPE i,
lr_current  
TYPE REF TO if_bol_bo_property_access,
lr_iterator 
TYPE REF TO if_bol_bo_col_iterator,
lv_parent   
TYPE ztree_product-product_id,
ls_prod_tree_par
TYPE ztree_product,
lt_prod_tree
TYPE STANDARD TABLE OF ztree_product,
ls_product_tree
TYPE ztree_product.
DATA : lr_valuenode        TYPE REF TO  cl_bsp_wd_value_node,
lr_col             
TYPE REF TO  if_bol_bo_col,
lr_tabline         
TYPE REF TO line,
ls_tabline         
TYPE line.

DATA: lv_entity           TYPE REF TO if_bol_bo_property_access.


CREATE OBJECT lr_col TYPE cl_crm_bol_bo_col.
lr_current ?= me
->bo.
lr_current
->get_property_as_value( EXPORTING iv_attr_name = 'PRODUCT_ID'  IMPORTING ev_result = lv_parent ).
CALL METHOD lr_current->get_properties
IMPORTING
es_attributes
= ls_prod_tree_par.
.
*  CHECK ls_prod_tree_par-parent_id IS INITIAL.
APPEND ls_prod_tree_par TO lt_prod_tree.
IF lv_parent IS NOT INITIAL.
LOOP AT zl_zbsp_tre_product_impl=>gt_tree_product INTO ls_product_tree WHERE parent_id EQ lv_parent.
CREATE DATA lr_tabline.
CREATE OBJECT lr_valuenode
EXPORTING
iv_data_ref
= lr_tabline.
CLEAR ls_tabline.
MOVE-CORRESPONDING ls_product_tree TO ls_tabline.
lr_valuenode
->set_properties( ls_tabline ).
lr_col
->add( lr_valuenode ).
ENDLOOP.
ENDIF.
IF sy-subrc NE 0.
EXIT.
ENDIF.
lv_entity ?= lr_col
->get_first( ).
WHILE lv_entity IS BOUND.
lr_child
= me->node_factory->get_proxy(
iv_bo
= lv_entity
iv_parent_proxy
= me
iv_proxy_type
= 'ZCL_PRODUCT_TREE' ).

lr_child
->is_leaf = abap_false.
*    lr_child->is_leaf = abap_true.
*    lr_child->expand_node( ).
APPEND lr_child TO rt_children.

lv_entity ?= lr_col->get_next( ).
ENDWHILE.
endmethod.

Viewing all 8768 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>