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

sap abap development

0 Likes
1,941

Hi Experts i had an requirement to create a mass upload for standard price with excel upload before execute i need to keep as a display mode once it is correct then i will be click execute radio button,

i have just started , could you please advice whether im going in the correct way. Code is below

report Y_BABU_TEST.

TYPE-POOLS: TRUXS.

*ABLES: MARA, MBEW.

TYPES: BEGIN OF TY_TAB,
DOCDATE TYPE STRING,
POSDATE TYPE STRING,
MATERIAL(18) TYPE C,
PURCHASE_CODE TYPE STRING,
MATERIAL_TYPE TYPE STRING,
PLANT(4) TYPE C,
PRICE TYPE STRING,
END OF TY_TAB.

TYPES : BEGIN OF ty_mara,
matnr TYPE matnr,
mtart TYPE mtart,
BIMST TYPE BIMST,
END OF ty_mara.




DATA:it_mara TYPE STANDARD TABLE OF ty_mara,

IT_TAB TYPE STANDARD TABLE OF TY_TAB,

WA_TAB TYPE TY_TAB.

DATA: IT_RAW TYPE TRUXS_T_TEXT_DATA.




PARAMETERS: P_COM TYPE BUKRS.

SELECTION-SCREEN SKIP 0.


parameters: P_file like rlgrap-filename.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.

CALL FUNCTION 'F4_FILENAME'
EXPORTING
PROGRAM_NAME = SYST-CPROG
DYNPRO_NUMBER = SYST-DYNNR
FIELD_NAME = ' '
IMPORTING
FILE_NAME = P_file.

START-OF-SELECTION.
CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
EXPORTING


I_TAB_RAW_DATA = IT_RAW

I_FILENAME = P_FILE

TABLES
I_TAB_CONVERT_DATA = IT_TAB[].




INITIALIZATION.

SELECTION-SCREEN SKIP 1.

SELECTION-SCREEN BEGIN OF BLOCK y_BABU_TEST_1 WITH FRAME TITLE text-001.

PARAMETERS: P_CHECK RADIOBUTTON GROUP RB1.
PARAMETERS: P_EXECU RADIOBUTTON GROUP RB1.

SELECTION-SCREEN END OF BLOCK y_BABU_TEST_1.

INITIALIZATION.
SELECTION-SCREEN BEGIN OF BLOCK y_BABU_TEST_2 WITH FRAME TITLE TEXT-001.

PARAMETERS: E_USER(12) DEFAULT SY-UNAME.
SELECTION-SCREEN END OF BLOCK y_BABU_TEST_2.

1 ACCEPTED SOLUTION
Read only

former_member1716
Active Contributor
1,819

babumechoo,

Before getting into the solution recommend you to follow few steps:

1) Search the forum First for similar requirement, similar requirements would have been already discussed.

2)Use CODE option when pasting any code for better readability.

3) Use comment option to add points relevant to the question, do not use Answer space if the content is no where related to the answer.

4) Please ensure your heading of the question is more relevant, the current heading is not relevant.

Solution:

You can follow below steps, there can be different solutions as well.

1) Load the data from the Excel and display it as an ALV display. This is similar to a normal ALV display. Remember to have the first field in the display as a checkbox and by default have it checked. By this you can provide an option to the user to un check any particular entry in case they decide not to update.

Note: The type of ALV you use defines how you handle the below steps, below steps are suggested assuming you are using GRID ALV method.

2) Add a new status to your program and Try to add a new button in the application Bar for example "UPDATE".

3) In your code as part of USER COMMAND Subroutine, introduce the code for updating the database. When the button the Update is clicked this code should be executed.

Regards!

6 REPLIES 6
Read only

0 Likes
1,819

pls help me to develop the code

Read only

Abinathsiva
Active Contributor
0 Likes
1,819

Hi Babu,

when more description on question is being given do use comment, don't use answer.

coming to question, requirement is to just display in test mode, or editable alv and post.

Read only

former_member1716
Active Contributor
1,820

babumechoo,

Before getting into the solution recommend you to follow few steps:

1) Search the forum First for similar requirement, similar requirements would have been already discussed.

2)Use CODE option when pasting any code for better readability.

3) Use comment option to add points relevant to the question, do not use Answer space if the content is no where related to the answer.

4) Please ensure your heading of the question is more relevant, the current heading is not relevant.

Solution:

You can follow below steps, there can be different solutions as well.

1) Load the data from the Excel and display it as an ALV display. This is similar to a normal ALV display. Remember to have the first field in the display as a checkbox and by default have it checked. By this you can provide an option to the user to un check any particular entry in case they decide not to update.

Note: The type of ALV you use defines how you handle the below steps, below steps are suggested assuming you are using GRID ALV method.

2) Add a new status to your program and Try to add a new button in the application Bar for example "UPDATE".

3) In your code as part of USER COMMAND Subroutine, introduce the code for updating the database. When the button the Update is clicked this code should be executed.

Regards!

Read only

0 Likes
1,819

Dear sir,

Thank you so much for your help and really sorry for posting in wrong tittle.

You are saying that im going in the correct way but i need to keep the display check as default and i need to update as a for all entries and i need to show in alv report right sir.

Read only

0 Likes
1,819

babumechoo,

Yes, Display all the entries with check box ticked by default and provide a button in Application bar for updating the database.You have plenty of resources available online.Regards!

Read only

0 Likes
1,819

Dear Abinath sir,

in upload file material, purchase code and new price will be available in the display we need material, purchase code , old price, new price.

parameters will be 2 radio button 1 is to display the values which i mentioned above

other radio button is upload in sap only new standard price

Regards,

Babu