Quantcast
Channel: SCN : All Content - ABAP Development
Viewing all 8332 articles
Browse latest View live

Email Address is being cleared for Ship To party Partner function in VA02 Sales order

$
0
0

Hi,

 

                I need to change Ship To  Address through programatically in VA01/VA02 transaction (Salesorder -SAPMV45A program) ,

Able to modify Address details like Company name,city ,country telephone number..etc  properly   using Function module , but observed Email Address is being cleared off after  my logic is being executed. 

 

i am using SD_PARTNER_ADDRESS_SET function module for Modifying Ship To partner address.

A new Address number (temporary number like : "WE &00001" ) is being created after passing to it.

 

i am passing Email Address also for this function module in parameters. Please help in this through your suggestions.

 

 

 

 

 

 

 

 

 

 

 

 

Thanks,

Vamsi


Dont want to clear previous value on selection-screen on value-request

$
0
0

Hi everybody!

 

I have to create a lot of long input texts (And the client ask for multilineal input texts [there are like 50 elements]) so i made this to fix the problem:

 

Just a cut code for example:

 

 

PARAMETERS: tipo TYPE Z_STRING.

 

at selection-screen on value-request for tipo.

   perform editor_texto using 'tipo'.



form editor_texto  using param.

   FIELD-SYMBOLS: <parametro> type any.

   DATA: lt_lines TYPE STANDARD TABLE OF tline,

              lv_line like line of lt_lines,

              lv_ind type i,

              lv_tope type i,

              lv_cant type i.

 

   ASSIGN (param) to <parametro>.

   if <parametro> is not initial.

     lv_cant = 130.

     while lv_ind lt strlen( <parametro> ).

       lv_tope = lv_cant + lv_ind.

       if lv_tope gt strlen( <parametro> ).

         lv_cant = strlen( <parametro> ) - lv_ind.

       endif.

       lv_line-TDLINE = <parametro>+lv_ind(lv_cant).

       append lv_line to lt_lines.

       add lv_cant to lv_ind.

     ENDWHILE.

   endif.

 

   CALL FUNCTION 'TERM_CONTROL_EDIT'

     EXPORTING

       titel          = text-046

       langu          = sy-langu

     TABLES

       textlines      = lt_lines

     EXCEPTIONS

       user_cancelled = 1

       OTHERS         = 2.

   while lt_lines[] is not initial and sy-subrc is initial.

     read table lt_lines into lv_line index 1.

     CONCATENATE <parametro> lv_line into <parametro> SEPARATED BY ' '.

     delete lt_lines index 1.

   ENDWHILE.

endform.

 

 

The problem is when you call with the F4 in the specific text input, Sap Automatically clear the value of the parameter before performing the rutine.

So, this only work to put new codes but not for changing an existing one...

 

How can I fix this problem?

If I can manage to keep the information avoiding the sap auto cleaning it will be great!

 

Thanks for your time and effort!

PS: I cant belive that in a SAP forum ABAPS isent one of the admit codes to get highlighted xD

Oficina / Ocupación Salas - PP30

$
0
0

Hello,

 

Someone please how to use this option?. Is it good to use for reserving meeting rooms, or it is for another purpose?

 

Thanks so much.

 

room.jpg

ALV List Subtotals and Totals using FM REUSE_ALV_BLOCK_LIST_APPEND

$
0
0

Hello Experts,

 

I have a requirement to display multiple tables so I used FM REUSE_ALV_BLOCK_LIST_APPEND.

 

Now I need to calculate the subtotals and totals but it doesn't work.

 

This is the fieldcatalog for the column I want to sum up

 

  ls_fieldcat-col_pos = 6.

  ls_fieldcat-fieldname = 'TNUM'.

  ls_fieldcat-seltext_m = 'Total Number'.

  ls_fieldcat-do_sum = 'X'.

  APPEND ls_fieldcat TO p_lt_fieldcat. CLEAR ls_fieldcat.

 

I tried using the same fieldcatalog in FM REUSE_ALV_LIST_DISPLAY and it gives me the total value.

Is this also possible for FM FM REUSE_ALV_BLOCK_LIST_APPEND ? If yes then am I missing anything to be passed on to that FM?

 

If you have any sample programs using FM FM REUSE_ALV_BLOCK_LIST_APPEND with subtotals and totals please share...It will be highly appreciated.

 

Please help. Thanks!

 

Regards,

Charm

how to pass parameters to SD_SALES_ITEM_COND_MAINTAIN

$
0
0

Dear ALL,

 

check the code:

 

DATA: it_konvkomx LIKE TABLE OF konvkomx WITH HEADER LINE.
DATA: it_konvkom LIKE TABLE OF konvkom WITH HEADER LINE.

 

IT_KONVKOM-KNUMV = '0000003174'.

IT_KONVKOM-KPOSN = '000010'.
IT_KONVKOM-ZAEHK = '1'.
IT_KONVKOM-STUNR = '050'.
IT_KONVKOM-KSCHL = 'ZDC3'.
IT_KONVKOM-KBETR = '10'.
IT_KONVKOM-WAERS = 'HKD'.
IT_KONVKOM-KMEIN = 'PAA'.
IT_KONVKOM-KPEIN = '1'.
IT_KONVKOM-J_3AETENR = '0002'.
IT_KONVKOM-koupd = 'X'.
IT_KONVKOM-KINAK = 'X'.
APPEND IT_KONVKOM.

IT_KONVKOMX-KPOSN = '000010'.
IT_KONVKOMX-STUNR = '010'.
IT_KONVKOMX-KSCHL = 'ZDC3'.
IT_KONVKOMX-ZAEHK = '01'.
IT_KONVKOMX-UPDKZ = 'I'.
IT_KONVKOMX-KBETR = 'X'.
IT_KONVKOMX-WAERS = 'X'.
IT_KONVKOMX-KMEIN = 'X'.
IT_KONVKOMX-KPEIN = 'X'.
IT_KONVKOMX-J_3AETENR = '0002'.
APPEND IT_KONVKOMX.

 

 

CALL FUNCTION 'SD_SALES_ITEM_COND_MAINTAIN'
   EXPORTING
     FIV_BWE            = ''
   TABLES
     fit_konvkom        = it_konvkom
     fit_konvkomx       = it_konvkomx
     fet_return         = it_so_return
            .

   CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.

 

the table it_so_return return the error:Country key  has no ISO code.

Why?

 

Thanks

Freddy

Post values into fb50 t code from zreport

$
0
0

Hi Everybody,

 

I have a requirement in which i have a zreport and in the report i should place a push button and once the report is generated and when the user clicks the button it should display FB50 t code and post the value from output  into a field in the standard t code. This requirement is only for one field.

 

I have done till fetching the t code. Now how can i post the particular value into the standard t code field.

 

Please refer attached file and kindly provide me your solutions please.

 

Regards,

Sam.

Enhancement used for vf01

$
0
0

Hi friends,

             I am new to enhancement.My task is,

           In vf01 t-code for header data when we click on save automatically the header text should be populated.

Now we should go to vf03 t-code and provide the generated billing number then in header text we should get the same invoice number i.e; in header text the invoice number should be generated.

Same excel but different outputs

$
0
0

Hello Experts,

 

I've a requirement where I need to attach an excel sheet in email and send it to user. I'm able to do it and when user click on the 'Preview file' button in the email then file look good as shown below.

 

However, when user double click on the file to open and view then view the file then first column is blank (Rerate Num column is blank) as shown below.

 

Here is my code for reference.

-----------------------------------------------------------------------------------------------------------------------------------------------------

* Email header info
   doc_chng-obj_name  = c_subject.
   doc_chng-obj_descr = c_subject.

* Create the message packing data
   clear i_packing-transf_bin.
   i_packing-head_start   = 1.
   i_packing-head_num     = 0.
   i_packing-body_start   = 1.
   i_packing-body_num     = 0.
   i_packing-doc_type     = 'RAW'.
   append i_packing.

* Report Summary header
  "concatenate text-001 sy-uname into lv_string separated by space.
   lv_string = text-001.
   append lv_string to i_objbin.
   "append text-002 to i_objbin.
   append cl_abap_char_utilities=>cr_lf to i_objbin.


clear: lv_row.
   lv_row = text-003.
   append lv_row to i_objbin.
   clear: lv_row.
   loop at lt_output into lw_output.
   append cl_abap_char_utilities=>cr_lf to i_objbin.
      lv_new_amt = lw_output-new_amt.
      condense lv_new_amt no-gaps.
     concatenate lw_output-zrerate "'|'
                 lw_output-kunrg "'|'
                 lw_output-name1 "'|'
                 lw_output-auart "'|'
                 lw_output-initiator "'|'
                 lv_new_amt "'|'
                 lw_output-erdat "'|'
                 lw_output-idocnum "'|'
                 lw_output-idocerror
                   into lv_row SEPARATED BY ','.
     append lv_row to i_objbin.
     clear: lv_new_amt, lv_row.
   lv_row = text-002.
   append lv_row to i_objbin.
   clear: lv_row.
   endloop.


"append text-002 to i_objbin.
   append cl_abap_char_utilities=>cr_lf to i_objbin.
   append cl_abap_char_utilities=>cr_lf to i_objbin.
   describe table i_objbin lines l_lines.

* create the message packing data
   i_packing-transf_bin   = 'X '.
   i_packing-head_start   = 1.
   i_packing-head_num     = 1.
   i_packing-body_start   = 1.
   i_packing-body_num     = l_lines.
   i_packing-doc_type     = 'CSV'."'RAW'.
   i_packing-obj_name     = 'EMAIL'.
   i_packing-obj_descr    = 'Re-rating Rebill order update summary'. "'Z_CRAETE_RERATE_DOC_order_creation_summary'.
   i_packing-doc_size     = l_lines * 255.
   append i_packing.

* send email
   call function 'SO_NEW_DOCUMENT_ATT_SEND_API1'
     exporting
       document_data              = doc_chng
       put_in_outbox              = ''
       commit_work                = 'X'
     tables
       packing_list               = i_packing    "Start of change 141.
       contents_bin               = i_objbin    "End of change 141.
       receivers                  = i_reclist
     exceptions
       too_many_receivers         = 1
       document_not_sent          = 2
       document_type_not_exist    = 3
       operation_no_authorization = 4
       parameter_error            = 5
       x_error                    = 6
       enqueue_error              = 7
       others                     = 8.


   if sy-subrc <> 0.
     message e188(zcpc) with 'Error sending email'.
   endif.


-----------------------------------------------------------------------------------------------------------------------------------------------------

Can somebody see what is the problem with my code and how to rectify it, please.

 

Many thanks in advance.


is it possible to do User authorization testing using SAP Ecatt?

$
0
0

    Hi guys.

 

          i am new to SAP Ecatt. i want to do authorization testing in user level.

    

          I don't have idea about Authorization testing using ECATT. Whether is it possible to do User authorization testing using SAP Ecatt?

 

     Thanks in Advance.

send PR number from outlook to SAP ME52N tcode

$
0
0

Hi Team,

 

i am preparing portal link and sending to outlook from abap. when user clicks that url link, then portal will open ME52N TCODE WITH PR number attached in url.

 

in url i kept like....https:/so and so (client server path) &ban& = '5454545456'. But when i click that url ..I can able to open ME52 IN PORTAL, but not with required number which i kept in url.

 

 

this works fine when i call me52 TCODE. Reason being inital screen of ME52 is having PR number filed with input mode. So that input filed is filled with number i kept in url.

 

 

 

 

Please help to solve this one.

 

Regards

Ramakrishnaiah Y

BAPI_MATERIAL_SAVEDATA creating material eventhough tax classification for some countries are blank

$
0
0

Recently we got an issue like, material got created even when there is no tax classification is maintained for some countries ie left blank. Material creation in the above case is happening through the FM BAPI_MATERIAL_SAVEDATA in a workflow where we will be filling all the details through the code. when i checked the program,,the tax classification for some countries are not filling, so ideally while creating material it should give an error but it is not giving instead it is creating material with blank value for tax classification. If we try manually in MM01,,material is not creating with blank tax classification value for the same data. kindly help to resolve this.

Smartform will print multiple time based on an output parameter.

$
0
0

Dear All,

I have an query. If possible then please help me. I want to take print of a single form but multiple time, i, e the form with the same layout will print 3 times if its related output parameter value is 3 and also will show 1 of 3, 2 of 3, 3 of 3 in a field. All other values and layout will be same but only one field will show this number 1 of 3, 2 of 3.....until that output counter ends. Is it possible ? I am showing an example of my requirement.

 

Prob1.JPG

Here Total containers are 3. So it will print 3 forms with the same layout and the field Container No. will show value for the 1st one as : 1of 3, for the 2nd one as: 2 of 3 and for the 3rd one as: 3 of 3.

 

Please tell me is it possible to do? If so then give me idea how to do this.

 

Thanks in advance.

 

 

Best regards,

Ferdous.

Alv Report Problem

$
0
0

Hi Expert,

 

 

 

I have a question of alv report.Actually I am making a zscreen and zreport for form38. In main screen there is three pushbutton- Create, change and display. there is new screen for every pushbutton like screen 201, 202,203 for create,change,display.when click on create 202 screen is call. in this screen there is 4 field- vendor-code, form38 no, date,remark. when user give vendor code and click on create button that time i want a new screen.in this new scree want to display all form 38 no for that vendor code. Below is the print screen.

 

z1.png

This is the main screen.

 

z2.png

when i give vendor code and click on create that a new srcreen appear in new scree want to display only all form 38 no for same vendor.

 

Please guide me expert.....

 

 

Thanks & Regards

 

Atin

Browse and Insert screen table in Dialog Programming

$
0
0

Hello Expert,

 

I have a requirement to Browse Image from user's System and display in custom control.

After click on save button it will save in Ztable with Image path So that user can view image on click on display in future.

 

 

I have searched many time but i didn't get exact solution.

Your help is appreciated.

 

Thanks & Regards,

Ranjit Kumar.

ALV tree in docking container

$
0
0

i am trying to call a docking container (on hotspot click of ALV.-> Reuse_alv_grid_display).

And a alv tree is to be displayed in docking container.

 

I have wrote the entire code and there is no error is thrown by the system, but docking container displayed.

I am posting entire code .Please let me know where i am mistaken.

 

check r_ucomm eq '&IC1'."when user double click on any cell of ALV.

   CASE rs_selfield-SEL_TAB_FIELD.

     WHEN 'I_MKPF-WERKS'.

       perform create_dock.

       perform create_alv_tree.

*           WHEN .

*           WHEN OTHERS.

   ENDCASE.

FORM CREATE_DOCK ."docking container is created

   check obj1 is initial.

   CREATE OBJECT OBJ1

     EXPORTING

*    PARENT                      =

     REPID                       = sy-repid

     DYNNR                       = sy-dynnr

       SIDE                        = obj1->DOCK_AT_bottom

     EXTENSION                   = 500

     EXCEPTIONS

       CNTL_ERROR                  = 1

       CNTL_SYSTEM_ERROR           = 2

       CREATE_ERROR                = 3

       LIFETIME_ERROR              = 4

       LIFETIME_DYNPRO_DYNPRO_LINK = 5

       others                      = 6

       .

   IF SY-SUBRC <> 0.

     MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

   ENDIF.

ENDFORM.         

FORM CREATE_ALV_TREE . "alv Tree

create object tree

     exporting

         parent              = obj1

         node_selection_mode = cl_gui_column_tree=>node_sel_mode_single

         item_selection      = 'X'

         no_html_header      = 'X'

         no_toolbar          = ''

     exceptions

         cntl_error                   = 1

         cntl_system_error            = 2

         create_error                 = 3

         lifetime_error               = 4

         illegal_node_selection_mode  = 5

         failed                       = 6

         illegal_column_name          = 7.

   if sy-subrc <> 0.

     message x208(00) with 'ERROR'.                          "#EC NOTEXT

   endif.

 

 

   data l_hierarchy_header type treev_hhdr.

   perform build_hierarchy_header changing l_hierarchy_header.

 

   IF gt_fieldcatalog[] is   initial.

     perform buildfield_cat using 'TRNTYP' 'TRNTYP' .

     perform buildfield_cat using 'EXDAT' 'Excise Doc' .

     perform buildfield_cat using 'WERKS' 'Excise Doc' .

     perform buildfield_cat using 'EXNUM' 'Excise Doc' .

     perform buildfield_cat using 'EXYEAR' 'Excise Doc' .

     perform buildfield_cat using 'MATNR' 'Excise Doc' .

     perform buildfield_cat using 'RITEM1' 'Excise Doc' .

     perform buildfield_cat using 'RITEM2' 'Excise Doc' .

     perform buildfield_cat using 'MAKTX' 'Excise Doc' .

     perform buildfield_cat using 'REMOVAL' 'Excise Doc' .

     perform buildfield_cat using 'MEINS' 'Excise Doc' .

     perform buildfield_cat using 'EXBAS' 'Excise Doc' .

     perform buildfield_cat using 'EXBED' 'Excise Doc' .

 

   endif.

 

call method tree->set_table_for_first_display

     EXPORTING

*      i_structure_name    = 'SFLIGHT'

       is_hierarchy_header = l_hierarchy_header

     CHANGING

       it_outtab           = t_J_1IEXCDTL[] "table must be empty !

       it_fieldcatalog     = gt_fieldcatalog.

 

 

perform create_hierarchy.

call method tree->frontend_update.

FORM CREATE_HIERARCHY .

sort IJ_1IEXCDTL by chapid matnr.

   LOOP AT IJ_1IEXCDTL into WJ_1IEXCDTL.

     on change of WJ_1IEXCDTL-chapid.

       perform add_carrid_line using    WJ_1IEXCDTL

                                              ''

                                    changing l_carrid_key.

     endon.

     on change of WJ_1IEXCDTL-matnr.

       perform add_complete_line using  WJ_1IEXCDTL"last complete line.

                                        l_carrid_key

                               changing l_last_key.

 

     endon.

   ENDLOOP.

endform.

form add_carrid_line using     WJ_1IEXCDTL1 type J_1IEXCDTL

                                p_relat_key type lvc_nkey

                      changing  p_node_key type lvc_nkey.

 

   data: l_node_text type lvc_value.

    

   l_node_text =   WJ_1IEXCDTL1-chapid.

   call method tree->add_node

     EXPORTING

       i_relat_node_key = p_relat_key

       i_relationship   = cl_gui_column_tree=>relat_last_child

       i_node_text      = l_node_text

       is_outtab_line   = WJ_1IEXCDTL

     IMPORTING

       e_new_node_key   = p_node_key.

endform.                    "add_carrid_line

form add_complete_line using   WJ_1IEXCDTL2 type J_1IEXCDTL

                              p_relat_key type lvc_nkey

                    changing  p_node_key type lvc_nkey.

 

   data: l_node_text type lvc_value.

   write WJ_1IEXCDTL2-matnr to l_node_text .

 

   call method tree->add_node

     EXPORTING

       i_relat_node_key = p_relat_key

       i_relationship   = cl_gui_column_tree=>relat_last_child

       is_outtab_line   = WJ_1IEXCDTL2

       i_node_text      = l_node_text

     IMPORTING

       e_new_node_key   = p_node_key.

 

endform.                    "add_complete_line


I want to delete last six months data from a table

$
0
0

Hi ,

i want to delete data from last six months from current system date

 

for example ,

 

table containing from jan 2012 to jan 2014 records ,

 

 

 

when i click on radio button ,  it should delete last  6 months data ie from jan 2012 to june 2012 .

 

please help me how to do it .

 

Thanks in advance

Populate 'staffing percentage' field on infotype 0001

$
0
0

Hi All,

I have an HR ABAP program to hire people and it works fine except for a couple of things.

The hiring action is successful but the percentage field on infotype 0001 under the organizational plan section is coming up as blank. My requirement is to default it to 100.00.

Manually, we can copy infotype 0000 and then save the record and the next screen (IT 0001 screen)allows us to enter the value for staffing percentage. To automate this process, I tried to do a BDC recording using PA30 to copy infotype 0000, infotype 0001 screen comes up but then the staffing field does not show up(it is hidden) therefore i cannot enter the percentage value. The BDC recording is supposed to bring up the same screens as the manual process but it is not and I have no clue why.

Please suggest a work around for this.

 

Thanks!

Sandeep

add last page in sap script

$
0
0

Hi All.

 

I have this requirement to add a last page in existing sapscript.

Also all the text are hard coded.

 

Please let me know the best approach to do that?

How to Send Vendor Form 16 Traces to Individual Mail id with attachment

$
0
0

Dear Team,

My requirement is

How to Send Vendor Form 16 Traces to Individual vendor Mail id with attachment. please suggest how to do this

 

Process

We are downloading all Vendor Form 16 Traces in one Folder

after then we will run the Program and select all the mail id along with Form 16 traces in bulk and run the program ,mail shoots individually to all the vendor with attachment of form 16 traces.

 

Unique no is Vendor Pan no in Traces.

 

Thanks in Advance....

 

 

Regards

Error message on same screen using TMG event

$
0
0

Dear All,

 

I am stuck due to a very small issue in TMG events.

 

Using TMG event 01, I need to do some validation and display some error messages.

 

But these error messages are coming on to the next screen and if I press 'Enter', it navigates back to same screen with data.

 

Requirement is:

  1. Error message on the same screen
  2. Disable all fields except the field which has error

 

Following is the screenshot of the error message on next screen:

error.JPG

 

Looking for a solution. Kindly help.

 

-

Regards

Deepak Batra

Viewing all 8332 articles
Browse latest View live


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