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

IN bdc uploading program select the data from db

Former Member
0 Likes
733

hi friends,

   iam write the bdc uploading program for transaction fd32, in this uploading file iam having fields below like this

       customerno   controlarea   creditlimit

            1               1000          30000

            2                1000          5000

   based upon uploading file(customer number), i want to select the data from CDPOS table based on customer number in cdpos table having same customer multiple records, but i want first record new_value only?

   iam trying different types of select statements but it is not working, i didnt get the data from database. if anybody know please tell me.

1 ACCEPTED SOLUTION
Read only

former_member585060
Active Contributor
0 Likes
696

Hi,

Add leading zero's to the Customer Numbers from file.

Then for all those Customer Number access CDPOS table by below select statement.

SELECT *

                 FROM CDPOS

                 INTO TABLE lt_cdpos

                 FOR ALL ENTRIES IN lt_file

                 WHERE OBJECTCLAS = 'KLIM'

                 AND       OBJECTID       = lt_file-kunnr

                 AND       TABNAME       = 'KNKK'

                 AND        FBAME           = 'KLIMK'

                 AND        VALUE_NEW <> space.

IF sy-subrc = 0.

  SORT lt_cdpos.

ENDIF.

Thanks & Regards

Bala Krishna

6 REPLIES 6
Read only

Former Member
0 Likes
696

Hi Priya,

Please select first than sorting by DESCENDING .Than u have to read it.Than u will get the Current data.

Thanks

Tarak

Read only

former_member585060
Active Contributor
0 Likes
697

Hi,

Add leading zero's to the Customer Numbers from file.

Then for all those Customer Number access CDPOS table by below select statement.

SELECT *

                 FROM CDPOS

                 INTO TABLE lt_cdpos

                 FOR ALL ENTRIES IN lt_file

                 WHERE OBJECTCLAS = 'KLIM'

                 AND       OBJECTID       = lt_file-kunnr

                 AND       TABNAME       = 'KNKK'

                 AND        FBAME           = 'KLIMK'

                 AND        VALUE_NEW <> space.

IF sy-subrc = 0.

  SORT lt_cdpos.

ENDIF.

Thanks & Regards

Bala Krishna

Read only

0 Likes
696

hi it will show error message like this...

when we are using for 'all entries in tab' the field objectid and it_tab-kunnr must have the same type ans same length

Read only

0 Likes
696

Create a new internal table with only one field and move all the customer numbers into that and use that table.

Ex:-

TYPES : BEGIN OF ty_kunnr,

                  kunnr TYPE cdpos-objectid,

                END OF ty_kunnr.

DATA : lt_kunnr     TYPE STANDARD TABLE OF ty_kunnr,

             wa_kunnr TYPE ty_kunnr.

LOOP AT lt_file INTO wa_file.

  wa_kunnr-kunnr = wa_file-kunnr.

ENDLOOP.

  

* Then use select.

SELECT *

                 FROM CDPOS

                 INTO TABLE lt_cdpos

                 FOR ALL ENTRIES IN lt_kunnr

                 WHERE OBJECTCLAS = 'KLIM'

                               AND             OBJECTID            = lt_kunnr-kunnr

                 AND       TABNAME       = 'KNKK'

                 AND        FBAME           = 'KLIMK'

                 AND        VALUE_NEW <> space.

IF sy-subrc = 0.

  SORT lt_cdpos.

ENDIF.

Thanks and Regards

Bala Krishna

Read only

Former Member
0 Likes
696

Hi,

   try control break statements in loop.

LOOP AT ITAB.

AT NEW customer no

perform fill_screen_details.

perform fill_field_details.

endat.

ENDLOOP.

Or if your flat is an excel type,put filter to customer no and take the req data and upload ..

Read only

0 Likes
696

hi, uploading is working but my is not uploading,

in uploading file iam having customer number i want to select the data from cdpos (FIELD- VALUE_NEW) table where customernumber is same.

    and then cdpos table value_new field having some amount, now i want to calculate the % cdpos value_new and Uploading file credit limit value, if percentage is 10% i want uploading data successfully, otherwise it will show error message it will not uploaded.